Current state
We can get ahold of the CancellationToken and IConsumerContext by:
letting the consumer extend IConsumerContextAware
use consumers without interfaces
Problem
The current state in 2.x does not promote the use of CancellationToken-s and requires users to make an extra step to bring that into the consumers.
Proposal
Add the CancellationToken and/or IConsumerContext to the core IConsumer<T> / IRequestHandler<T, R>
interfaces.
Backward compatibility consideration
Is it worth doing it backward compatible (new interface and old would be maintained)?
The benefit is that users could easily update the library.
On the other hand it might be okay to break the interface (not much updates for users).
We would do this as part of 3.x release.
Current state We can get ahold of the CancellationToken and IConsumerContext by:
IConsumerContextAware
Problem The current state in 2.x does not promote the use of CancellationToken-s and requires users to make an extra step to bring that into the consumers.
Proposal Add the
CancellationToken
and/orIConsumerContext
to the coreIConsumer<T>
/IRequestHandler<T, R>
interfaces.Backward compatibility consideration Is it worth doing it backward compatible (new interface and old would be maintained)? The benefit is that users could easily update the library. On the other hand it might be okay to break the interface (not much updates for users). We would do this as part of 3.x release.