Title: Cancellation Tokens · Issue #2235 · DSharpPlus/DSharpPlus · GitHub
Open Graph Title: Cancellation Tokens · Issue #2235 · DSharpPlus/DSharpPlus
X Title: Cancellation Tokens · Issue #2235 · DSharpPlus/DSharpPlus
Description: Description I enjoy using D#+ because it manages rate limits for me. However, once i ask it to do something, it could be a long time before i see the result come back to me. Take the following as an example. private async Task StartFiveM...
Open Graph Description: Description I enjoy using D#+ because it manages rate limits for me. However, once i ask it to do something, it could be a long time before i see the result come back to me. Take the following as a...
X Description: Description I enjoy using D#+ because it manages rate limits for me. However, once i ask it to do something, it could be a long time before i see the result come back to me. Take the following as a...
Opengraph URL: https://github.com/DSharpPlus/DSharpPlus/issues/2235
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cancellation Tokens","articleBody":"### Description\n\nI enjoy using D#+ because it manages rate limits for me.\n\nHowever, once i ask it to do something, it could be a long time before i see the result come back to me.\n\nTake the following as an example.\n\n```cs\nprivate async Task StartFiveMinuteTimer(CancellationToken cancellationToken)\n{\n PeriodicTimer timer = new(TimeSpan.FromMinutes(5));\n do \n { \n using CancellationTokenSource fiveMinuteToken= new CancellationTokenSource(TimeSpan.FromMinutes(5));\n using CancellationTokenSource linkedToked = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, fiveMinuteToken.Token);\n \n // ommited some other stuff like DB queries and HTTP requests that utilize the above tokens\n \n await discordChannel.ModifyAsync(x =>\n {\n x.Name = name;\n });\n } while (await timer.WaitForNextTickAsync(cancellationToken));\n}\n```\n\nHere, its possible that the PeriodicTimer does not tick every 5 minutes if renaming the discordChannel is waiting until it knows it will not hit a rate limit.\n\nWould it be possible for us to somehow say \"hey D#+, give up trying to rename that channel\", possibly through the use of CancellationToken's or other means.\n\n### Specify the libraries you want this feature request to affect\n\nDSharpPlus, the core library, DSharpPlus.Rest\n\n### Other considerations\n\nIf you believe your too small to make an impact on this world, try spending the night with a couple of mosquitos.","author":{"url":"https://github.com/ecrocombe","@type":"Person","name":"ecrocombe"},"datePublished":"2025-01-27T04:43:25Z","url":"https://github.com/DSharpPlus/DSharpPlus/issues/2235"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4f3267b8-5694-b649-995d-03bf842b6a10 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A53A:3F5E9C:25C1E2F:309FD10:6B03F56E |
| html-safe-nonce | 849e4f337f6aaccc9f9f8ec92320fc8f42ca25de71a93860194c2162c1b1b0f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTNBOjNGNUU5QzoyNUMxRTJGOjMwOUZEMTA6NkIwM0Y1NkUiLCJ2aXNpdG9yX2lkIjoiNDYwNDM5NDMwODIxNTUwMjE5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8e53c3665067d9a0fcc97b3dd43090a29d997353b475280b18499db51199b33a |
| hovercard-subject-tag | issue:2812069540 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/DSharpPlus/DSharpPlus/2235/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f3980ebf955df5ca52913918a91bef97f1d6a9213bee288b862a4809fb8f6e82/DSharpPlus/DSharpPlus/issues/2235 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f3980ebf955df5ca52913918a91bef97f1d6a9213bee288b862a4809fb8f6e82/DSharpPlus/DSharpPlus/issues/2235 |
| og:image:alt | Description I enjoy using D#+ because it manages rate limits for me. However, once i ask it to do something, it could be a long time before i see the result come back to me. Take the following as a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ecrocombe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/DSharpPlus/DSharpPlus git https://github.com/DSharpPlus/DSharpPlus.git |
| octolytics-dimension-user_id | 36208721 |
| octolytics-dimension-user_login | DSharpPlus |
| octolytics-dimension-repository_id | 67243489 |
| octolytics-dimension-repository_nwo | DSharpPlus/DSharpPlus |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 67243489 |
| octolytics-dimension-repository_network_root_nwo | DSharpPlus/DSharpPlus |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width