Interface IOutputDispatcher

Defines a dispatcher that broadcasts published values to one or more subscribers (blocks).

Namespace: MOSAIC.Components.Interfaces
Assembly: MOSAIC.dll
Syntax
public interface IOutputDispatcher
Remarks

Implementations manage a set of ISubscriber instances and forward values produced by a publisher (typically a processing block) to those subscribers.

The dispatcher operates on runtime-typed payloads (object). Subscribers are responsible for validating and casting the received values to the expected types.

Methods

AddSubscriber(ISubscriber)

Registers a subscriber so it will receive values dispatched by this dispatcher.

Declaration
void AddSubscriber(ISubscriber subscriber)
Parameters
Type Name Description
ISubscriber subscriber

The subscriber (block) instance that will receive dispatched values.

Exceptions
Type Condition
ArgumentNullException

Thrown if subscriber is null.

Dispatch(object, object)

Dispatches a value to all registered subscribers.

Declaration
void Dispatch(object sender, object value)
Parameters
Type Name Description
object sender

The originator of the value (typically the publishing block).

object value

The value payload to broadcast to subscribers.

Remarks

Implementations may choose synchronous or asynchronous delivery semantics. Callers should not assume ordering guarantees unless explicitly documented by the concrete dispatcher implementation.

RemoveSubscriber(ISubscriber)

Unregisters a subscriber so it no longer receives dispatched values.

Declaration
void RemoveSubscriber(ISubscriber subscriber)
Parameters
Type Name Description
ISubscriber subscriber

The subscriber (block) instance to remove.

Exceptions
Type Condition
ArgumentNullException

Thrown if subscriber is null.

Search documentation

Start typing to search the documentation.