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

🧱 CancellationToken #23

Open
karafra opened this issue Mar 25, 2022 · 3 comments
Open

🧱 CancellationToken #23

karafra opened this issue Mar 25, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@karafra
Copy link

karafra commented Mar 25, 2022

Would it be possible to add support for cancelling tasks, main method that needs this is NextTweetStreamAsync because as of now it is not possible to stop stream execution. This causes multiple problems:

  • NextTweetStreamAsync is effectively blocking call, cannot be stopped in any way
  • Implementation of handler function is effectively locked and can be changed only in very stupid ways

Off the top of my head there are two solutions to this situation

  • Exposing streams with tweets to users
  • Adding support for CancellationToken (this ticket)

If you do not see any problems with this ticket I am willing to make PR to fix this problem.

I thank for your response in advance 🙏🏼

@karafra
Copy link
Author

karafra commented Mar 25, 2022

Closed the wrong ticket 🤦🏼

@Xwilarg
Copy link
Owner

Xwilarg commented Mar 25, 2022

Hi,

Is CancelTweetStream not fitting your needs?

@karafra
Copy link
Author

karafra commented Mar 25, 2022

Hi,

Well in my opinion this are 2 totally different things, CancelTweetStream should in my opinion be used when you are closing stream willingly. Addition of logic for cancellation token would allow closure for failing tasks from outside without need to run NextTweetStreamAsync in the background.

I was a bit upfront and already implemented "changes in logic" along with small refactor in this PR 💪🏼 😊

@Xwilarg Xwilarg added the enhancement New feature or request label Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants