-
Notifications
You must be signed in to change notification settings - Fork 5
Description
I propose that we amend the async.AckFunc method signature (https://github.com/uw-labs/substrate-tools/blob/master/async/source.go#L36) such that it no longer returns an error itself, but instead causes the parent async.ConsumeMessages function to return. This change would simplify execution path of the provided async.ConsumerMessageHandler and allow the user to simply defer ack(), should they wish.
At the time of writing the current implementation only returns a non-nil error when the context passed to async.ConsumerMessageHandler is cancelled.
A consideration: the current implementation provides immediate feedback should the context be cancelled and therefore the ack not be processed, which allows the user to rollback any transactions made during execution of their message handler code. Implementing this change would mean that feedback would only be provided after the message handler code returns.
Related discussion: #6 (review)