Closed lpegoraro closed 10 months ago
This package was written before the Context
package was released (back in 2016 with Go 1.7!) so was designed without contexts in mind. While I have considered introducing Context
I'm not sure that there are sufficient benefits to justify the change.
pass a context inside the handleFunc,
Where would this context come from and what would it contain? The handler is called from here; it would be possible to pass in a context which gets cancelled if the connection drops (or Disconnect()
is called) but I don't really see any real benefit to this (generally you would still want to process the message anyway, and long running handlers are a bad idea).
It might help if you provided a usage example and explain what situations would result in the context being cancelled.
Closing this due to inactivity (the requested info was not provided).
Hi all, great tool btw, thanks a lot for this!
I am using this
Subscribe
method hereAnd I would like to pass a context inside the handleFunc, because of context cancellation propagation.
And looking here
we don't have any option to pass along the context, what do you guys think of having this change
I did look for some issues related but found none.