DataSource.NET
7.1.29.112283-2b6ad187
|
An instance of IPublisher publishes messages to remote DataSource peers on behalf of an IDataProvider. It also provides access to an IMessageFactory that creates the messages to be published. More...
Public Member Functions | |
void | PublishInitialMessage (IMessage message) |
Publishes the initial message of the data for a Subject to peers that have just requested (subscribed to) that subject. More... | |
void | PublishMappingMessage (IMappingMessage mapping) |
Publishes to all peers subscribed to a subject a message that instructs the remote peer to request an alternate subject in order to satisfy the subscription. More... | |
void | PublishSubjectErrorEvent (ISubjectErrorEvent ev) |
Publishes to all peers subscribed to a subject an event detailing an error in the subscription for that subject. Typically an IDataProvider will use this to notify the remote peers that an string they are subscribed to is no longer available. More... | |
void | PublishSubjectStatusEvent (ISubjectStatusEvent ev) |
Publishes to all subscribed peers an event about the change in status of a subject. More... | |
void | PublishToSubscribedPeers (IMessage message) |
Publishes a message to subscribed peers (that is, the peers that have already received an initial image). More... | |
Properties | |
IMessageFactory | MessageFactory [get] |
Gets the IMessageFactory used to create the messages that are published via this publisher. More... | |
An instance of IPublisher publishes messages to remote DataSource peers on behalf of an IDataProvider. It also provides access to an IMessageFactory that creates the messages to be published.
DataSource.NET includes several implementations of IPublisher that you can use in your DataSource application: see IBroadcastPublisher, IActivePublisher. To use one of these IPublishers call the appropriate "create publisher" method of DataSource: CreateBroadcastPublisher, or CreateActivePublisher.
These three child interfaces declare no methods further to those declared in IPublisher and currently only serve to tag each IPublisher type. However, it is possible that future versions of DataSource.NET may add publisher-type specific methods to these interfaces if deemed appropriate or useful.
The following example shows an IPublisher being created by calling the Caplin.DataSource.DataSource.CreateActivePublisher method of the DataSource. An Caplin.DataSource.Namespace.INamespace is provided so that the created IPublisher knows which strings it must service.
void Caplin.DataSource.Publisher.IPublisher.PublishInitialMessage | ( | IMessage | message | ) |
Publishes the initial message of the data for a Subject to peers that have just requested (subscribed to) that subject.
message | The message to be published. |
void Caplin.DataSource.Publisher.IPublisher.PublishMappingMessage | ( | IMappingMessage | mapping | ) |
Publishes to all peers subscribed to a subject a message that instructs the remote peer to request an alternate subject in order to satisfy the subscription.
mapping | The IMappingMesssage to be published. |
Publishing a mapping message satisfies the "initial message" requirement.
void Caplin.DataSource.Publisher.IPublisher.PublishSubjectErrorEvent | ( | ISubjectErrorEvent | ev | ) |
Publishes to all peers subscribed to a subject an event detailing an error in the subscription for that subject. Typically an IDataProvider will use this to notify the remote peers that an string they are subscribed to is no longer available.
ev | The ISubjectErrorEvent to be published. |
void Caplin.DataSource.Publisher.IPublisher.PublishSubjectStatusEvent | ( | ISubjectStatusEvent | ev | ) |
Publishes to all subscribed peers an event about the change in status of a subject.
ev | The subject status event to be published. |
void Caplin.DataSource.Publisher.IPublisher.PublishToSubscribedPeers | ( | IMessage | message | ) |
Publishes a message to subscribed peers (that is, the peers that have already received an initial image).
message | The message to be published. This may be an image or an update. |
|
get |
Gets the IMessageFactory used to create the messages that are published via this publisher.
The message factory.