Skip to content

[Core] Incorporate CancellationToken and/or IConsumerContext to the Consumer interfaces #246

@zarusz

Description

@zarusz

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions