client: Implement Events() #66

Closed
farcaller opened this Issue Jan 29, 2014 · 6 comments

Comments

4 participants

Events(since uint64) should return a channel (or take a channel and send data to it?) that will get /events updates. It must also gracefully handle network interruptions (reconnect with last good time value).

Contributor

jhulten commented Feb 19, 2014

+1

Taking a channel allows the caller to specify it is done by closing the channel. Thoughts @fsouza?

I am willing to take a swing at this.

Owner

fsouza commented Feb 19, 2014

@jhulten the reader should never close the channel.

I imagine that Events(since uint64) could create a goroutine and write the output to a channel that it returns. Something like:

ch := make(chan type, size)
go func() {
  for _, event := range events {
     ch <- event
  }
  close(ch)
}()
return ch

What do you think?

Contributor

jhulten commented Feb 20, 2014

I put a stake in the ground with #71. I will look at changing it to return a channel tomorrow.

Owner

fsouza commented Feb 20, 2014

Thank you, I will have a look within the next hours :)

Contributor

destari commented May 3, 2014

Should this be closed now?

Owner

fsouza commented May 3, 2014

Sure. Thanks!

fsouza closed this May 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment