Interface IEventPublisher
Publishes the messages implementing IEvent.
Namespace: Silverback.Messaging.Publishing
Assembly: Silverback.Core.Model.dll
Syntax
public interface IEventPublisher
Methods
| Improve this doc View sourcePublish(IEvent)
Publishes the specified event to the internal bus. The message will be forwarded to its subscribers and the method will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).
Declaration
void Publish(IEvent eventMessage)
Parameters
Type | Name | Description |
---|---|---|
IEvent | eventMessage | The event to be published. |
Publish(IEvent, bool)
Publishes the specified event to the internal bus. The message will be forwarded to its subscribers and the method will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).
Declaration
void Publish(IEvent eventMessage, bool throwIfUnhandled)
Parameters
Type | Name | Description |
---|---|---|
IEvent | eventMessage | The event to be published. |
bool | throwIfUnhandled | A boolean value indicating whether an exception must be thrown if no subscriber is handling the message. |
PublishAsync(IEvent)
Publishes the specified event to the internal bus. The message will be forwarded to its subscribers and the Task will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).
Declaration
Task PublishAsync(IEvent eventMessage)
Parameters
Type | Name | Description |
---|---|---|
IEvent | eventMessage | The event to be executed. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
PublishAsync(IEvent, bool)
Publishes the specified event to the internal bus. The message will be forwarded to its subscribers and the Task will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).
Declaration
Task PublishAsync(IEvent eventMessage, bool throwIfUnhandled)
Parameters
Type | Name | Description |
---|---|---|
IEvent | eventMessage | The event to be executed. |
bool | throwIfUnhandled | A boolean value indicating whether an exception must be thrown if no subscriber is handling the message. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |