go-pubsub
go-pubsub copied to clipboard
Message Producer Context
For easier extendability I think Put message should have signature like:
PutMessage(ctx context.Context, message pubsub.ProducerMessage) error {
With current implementation wrapping this method with per request or per action behaviors is imposible. Consumer does use context.
I see the need for this in the consumer case, where the message handling itself may block or take a long time. I'm wondering about the producer case though. Why would you expect this to block? Is it as simple as the broken being slow for some reason, or have I missed something bigger?
This is addressed in substrate. : https://github.com/uw-labs/substrate