Interface ISubscriber<TRequest>
- Namespace
- Savvyio.Messaging
- Assembly
- Savvyio.Core.dll
Defines a subscriber/receiver channel used by subsystems to subscribe to messages (typically events) to be made aware of something that has happened.
public interface ISubscriber<out TRequest>
where TRequest : IRequest
Type Parameters
TRequest
The type of the model to invoke on a handler.
Methods
SubscribeAsync(Func<IMessage<TRequest>, CancellationToken, Task>, Action<SubscribeAsyncOptions>)
Subscribe to one or more message(s) asynchronous using Publish-Subscribe Channel/Pub-Sub MEP.
Task SubscribeAsync(Func<IMessage<TRequest>, CancellationToken, Task> asyncHandler, Action<SubscribeAsyncOptions> setup = null)
Parameters
asyncHandler
Func<IMessage<TRequest>, CancellationToken, Task>The function delegate that will handle the message.
setup
Action<SubscribeAsyncOptions>The SubscribeAsyncOptions which may be configured.
Returns
- Task
A System.Threading.Tasks.Task that represents the asynchronous operation.