Skip to content

Close Events Channel - #3

Open
indiependente wants to merge 2 commits into
sebkl:masterfrom
indiependente:master
Open

Close Events Channel#3
indiependente wants to merge 2 commits into
sebkl:masterfrom
indiependente:master

Conversation

@indiependente

Copy link
Copy Markdown

Gracefully closing channel

  • There are situations where an unclosed channel could end up in leaving the reader hanging for more data, even if a nil value has been sent.
  • Closing the channel is the right way to tell the reader that there's no more data and that it can move forward.

SearchStream: gracefully closing of the events channel
On line 108 there is a nil sent to the events channel which keeps the channel still open.
Changing it to a deferred close fixes the issue.
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