Interface IBehavior
- Namespace
- Silverback.Messaging.Publishing
- Assembly
- Silverback.Core.dll
Can be used to build a custom pipeline, plugging some functionality into the IPublisher.
public interface IBehavior
Methods
HandleAsync(IPublisher, object, MessageHandler, CancellationToken)
Process, handles or transforms the messages being published via the message bus.
ValueTask<IReadOnlyCollection<object?>> HandleAsync(IPublisher publisher, object message, MessageHandler next, CancellationToken cancellationToken)
Parameters
publisherIPublisherThe IPublisher that is publishing the message.
messageobjectThe message being published.
nextMessageHandlerThe next behavior in the pipeline.
cancellationTokenCancellationTokenThe CancellationToken that can be used to cancel the operation.
Returns
- ValueTask<IReadOnlyCollection<object>>
A ValueTask<TResult> representing the asynchronous operation. The task result contains the result values (if any).