Creates a subject status event.
Declaration Syntax
C# | Visual Basic | Visual C++ |
ISubjectStatusEvent CreateSubjectStatusEvent( string subject, SubjectStatus status, string message )
Function CreateSubjectStatusEvent ( _ subject As String, _ status As SubjectStatus, _ message As String _ ) As ISubjectStatusEvent
ISubjectStatusEvent^ CreateSubjectStatusEvent( String^ subject, SubjectStatus status, String^ message )
Parameters
- subject (String)
- The subject to which the status relates.
- status (SubjectStatus)
- The status.
- message (String)
- A free form textual message indicating the reason for the status message being raised.
Return Value
A subject status event.
Examples
The following example shows how to create an ISubjectStatusEvent for a specified subject,
and send it to all peers that have requested that subject.
CopyC#
using Caplin.DataSource; using Caplin.DataSource.Messaging; using Caplin.DataSource.Messaging.Record; using Caplin.DataSource.Publisher; namespace DataSourceExamples.Messaging { public class SendSubjectStatusEvent { void SendSubjectStatusToSubscribedPeers(IPublisher publisher, string subject) { // Create a Stale subject status event. ISubjectStatusEvent ev = publisher.MessageFactory.CreateSubjectStatusEvent(subject, SubjectStatus.Stale, "Object is stale"); // And publisher to all subscribed peers. publisher.PublishSubjectStatusEvent(ev); } } }