Class NotificationService
A simple pub/sub messaging service that supports
multiple message routers.
Inheritance
NotificationService
Assembly: PeerTalk.dll
Syntax
public class NotificationService : IService, IPubSubApi
Fields
|
Improve this Doc
View Source
DuplicateMesssagesReceived
The number of duplicate messages that have been received.
Declaration
public ulong DuplicateMesssagesReceived
Field Value
|
Improve this Doc
View Source
MesssagesPublished
The number of messages that have published.
Declaration
public ulong MesssagesPublished
Field Value
|
Improve this Doc
View Source
MesssagesReceived
The number of messages that have been received.
Declaration
public ulong MesssagesReceived
Field Value
Properties
|
Improve this Doc
View Source
LocalPeer
Declaration
public Peer LocalPeer { get; set; }
Property Value
|
Improve this Doc
View Source
Routers
Sends and receives messages to other peers.
Declaration
public List<IMessageRouter> Routers { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
CreateMessage(String, Byte[])
Creates a message for the topic and data.
Declaration
public PublishedMessage CreateMessage(string topic, byte[] data)
Parameters
Type |
Name |
Description |
String |
topic |
The topic name/id.
|
Byte[] |
data |
The payload of message.
|
Returns
|
Improve this Doc
View Source
PeersAsync(String, CancellationToken)
Declaration
public Task<IEnumerable<Peer>> PeersAsync(string topic = null, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
PublishAsync(String, Byte[], CancellationToken)
Declaration
public Task PublishAsync(string topic, byte[] message, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
PublishAsync(String, Stream, CancellationToken)
Declaration
public Task PublishAsync(string topic, Stream message, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
PublishAsync(String, String, CancellationToken)
Declaration
public Task PublishAsync(string topic, string message, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
StartAsync()
Declaration
Returns
|
Improve this Doc
View Source
StopAsync()
Declaration
Returns
|
Improve this Doc
View Source
SubscribeAsync(String, Action<IPublishedMessage>, CancellationToken)
Declaration
public Task SubscribeAsync(string topic, Action<IPublishedMessage> handler, CancellationToken cancellationToken)
Parameters
Returns
|
Improve this Doc
View Source
SubscribedTopicsAsync(CancellationToken)
Declaration
public Task<IEnumerable<string>> SubscribedTopicsAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Returns
Implements