You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the gochan protocol for some internal processing of events. I've built a series of cloudevents.Client like so:
Client #1 listens on HTTP for events
For each event received on #1 we send to client #2 using a gochan.Protocol sender.
Client #3 is receiving from the same gochan.Protocol used in #2
For each event received on #3 we send to another client #4 which uses HTTP to an external target.
There's currently no way to wait until all events have finished with the current implementation of gochan.Protocol since it doesn't implement protocol.SendCloser.
You can cancel the ctx passed to client.StartReceiver(), but if you have any outstanding messages not yet received the receiver returns io.EOF as expected.
Closing the underlying channel allows StartReceiver() to continue processing all messages until eventually it returns io.EOF due to the channel being closed, and not because ctx was cancelled.
All this involves is changing gochan.Protocol to have an additional method:
I'm using the
gochan
protocol for some internal processing of events. I've built a series ofcloudevents.Client
like so:#1
listens on HTTP for events#1
we send to client#2
using agochan.Protocol
sender.#3
is receiving from the samegochan.Protocol
used in#2
#3
we send to another client#4
which uses HTTP to an external target.There's currently no way to wait until all events have finished with the current implementation of
gochan.Protocol
since it doesn't implementprotocol.SendCloser
.You can cancel the
ctx
passed toclient.StartReceiver()
, but if you have any outstanding messages not yet received the receiver returnsio.EOF
as expected.Closing the underlying channel allows
StartReceiver()
to continue processing all messages until eventually it returnsio.EOF
due to the channel being closed, and not becausectx
was cancelled.All this involves is changing
gochan.Protocol
to have an additional method:Is this sensible, or am I missing something?
The text was updated successfully, but these errors were encountered: