Interface IPublisher

Defines a publisher that can register and unregister subscribers (blocks) for downstream delivery.

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

A publisher maintains a set of ISubscriber instances that should receive values produced by the publisher. The actual delivery of values is typically performed by the concrete publisher itself (e.g., via a dispatcher).

This interface does not prescribe payload typing. In MOSAIC, payloads are commonly passed as runtime-typed object values, and subscribers are responsible for validating and casting received values.

Methods

AddSubscriber(ISubscriber)

Registers a subscriber so it will receive values produced by this publisher.

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

The subscriber (block) instance to register.

Exceptions
Type Condition
ArgumentNullException

Thrown if subscriber is null.

RemoveSubscriber(ISubscriber)

Unregisters a subscriber so it no longer receives values produced by this publisher.

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

The subscriber (block) instance to unregister.

Exceptions
Type Condition
ArgumentNullException

Thrown if subscriber is null.

Search documentation

Start typing to search the documentation.