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

Add options to New, WithContext option for cancellation #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

geezyx
Copy link

@geezyx geezyx commented Apr 14, 2023

Saw this reddit post where someone was struggling to cancel a streamer that was hung.

This PR adds the following:

  • An internal context.Context to the Streamer struct which is used for checking for external cancellation via the contexts Done() channel.
  • Variadic options input to the New constructor to allow for additional user configuration of the Streamer.
  • WithContext options function allowing for a context to be provided by the caller.

I'm not sure if this is the right approach, but wanted to offer it as a possible solution and hopefully help with the reddit post's question.

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

Successfully merging this pull request may close these issues.

1 participant