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
Neither IConsumer nor IRequestHandler include the CancellationToken associated with the message context as a method parameter.
It is accessible via IConsumerContext injection, but the implementation is not ideal as it breaks the facade of isolation from the message broker. Using setter injection also negates the ability to use a single consumer instance for concurrent processing.
The text was updated successfully, but these errors were encountered:
I agree in general, it would be better to have CancellationToken added as part of the consumer method.
There could also be an improvement added for concurrent consumers (.Instances(N) where N > 1) where the message processing pipeline would create N per-message scopes, rather than 1 nowadays.
In the long run, I was considering adding CancellationToken to the consumer methods in the future SMB v3. This perhaps would result in a breaking change to IConsumer<T>, or an additional interface that could be used.
I saw you have the PR for this feature using the consumer without the interface, which is a good middle-ground before v3.
Neither
IConsumer
norIRequestHandler
include theCancellationToken
associated with the message context as a method parameter.It is accessible via
IConsumerContext
injection, but the implementation is not ideal as it breaks the facade of isolation from the message broker. Using setter injection also negates the ability to use a single consumer instance for concurrent processing.The text was updated successfully, but these errors were encountered: