Class EventPublisher
Publishes the messages implementing IEvent.
Implements
Inherited Members
Namespace: Silverback.Messaging.Publishing
Assembly: Silverback.Core.Model.dll
Syntax
public class EventPublisher : IEventPublisherConstructors
| Improve this doc View sourceEventPublisher(IPublisher)
Initializes a new instance of the EventPublisher class.
Declaration
public EventPublisher(IPublisher publisher)Parameters
| Type | Name | Description | 
|---|---|---|
| IPublisher | publisher | The IPublisher to be wrapped. | 
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
public 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
public 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
public 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
public 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. |