Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider adding a CancellationToken as parameter for async methods #36

Open
swiftyspiffy opened this issue May 17, 2018 · 3 comments

Comments

@swiftyspiffy
Copy link
Member

From @niklr on April 12, 2018 10:1

Is it currently possible to cancel a pending async method? What happens if Twitch is down: will the sync/async methods run forever or cancel/timeout after a specific time?

Please consider adding a CancellationToken as parameter for async methods. Additionally, consider the possibility to specify a number of milliseconds to wait before requests time out.

Copied from original issue: TwitchLib/TwitchLib#389

@swiftyspiffy
Copy link
Member Author

From @LuckyNoS7evin on April 12, 2018 10:17

@niklr Thanks for this, we are still working on the system and after some big changes we have made recently we are looking to implement things like this.

At the moment you are correct in asking but the async task will "timeout" if twitch is down, you'll almost instantly get an exception

@swiftyspiffy
Copy link
Member Author

From @Syzuna on April 12, 2018 10:52

@niklr Thanks for your suggestion again.

Yes CancellationToken Support is sth we should/want to implement in the near future for sure.

For your other concern: The calls to the TwitchApi are based on Http calls so if a server is down that http call will come back with a http error Code and will be handled accordingly that in the end leads to an excepion being raised.

Regards

Syzuna

@RRickkert
Copy link
Member

Working on trying some stuff out with the LiveStreamMonitor, I noticed that this might be a very helpful feature to cancel requests when the list of channels has been changed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants