Show / Hide Table of Contents

Class NotificationService

A simple pub/sub messaging service that supports multiple message routers.

Inheritance
Object
NotificationService
Implements
IService
IPubSubApi
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: PeerTalk.PubSub
Assembly: PeerTalk.dll
Syntax
public class NotificationService : IService, IPubSubApi
Remarks

Relies upon the router(s) to deliver and receive messages from other peers.

Fields

| Improve this Doc View Source

DuplicateMesssagesReceived

The number of duplicate messages that have been received.

Declaration
public ulong DuplicateMesssagesReceived
Field Value
Type Description
UInt64
| Improve this Doc View Source

MesssagesPublished

The number of messages that have published.

Declaration
public ulong MesssagesPublished
Field Value
Type Description
UInt64
| Improve this Doc View Source

MesssagesReceived

The number of messages that have been received.

Declaration
public ulong MesssagesReceived
Field Value
Type Description
UInt64

Properties

| Improve this Doc View Source

LocalPeer

The local peer.

Declaration
public Peer LocalPeer { get; set; }
Property Value
Type Description
Peer
| Improve this Doc View Source

Routers

Sends and receives messages to other peers.

Declaration
public List<IMessageRouter> Routers { get; set; }
Property Value
Type Description
List<IMessageRouter>

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
Type Description
PublishedMessage

A unique published message.

Remarks

The SequenceNumber is a monitonically increasing unsigned long.

| Improve this Doc View Source

PeersAsync(String, CancellationToken)

Declaration
public Task<IEnumerable<Peer>> PeersAsync(string topic = null, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String topic
CancellationToken cancel
Returns
Type Description
Task<IEnumerable<Peer>>
| Improve this Doc View Source

PublishAsync(String, Byte[], CancellationToken)

Declaration
public Task PublishAsync(string topic, byte[] message, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String topic
Byte[] message
CancellationToken cancel
Returns
Type Description
Task
| Improve this Doc View Source

PublishAsync(String, Stream, CancellationToken)

Declaration
public Task PublishAsync(string topic, Stream message, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String topic
Stream message
CancellationToken cancel
Returns
Type Description
Task
| Improve this Doc View Source

PublishAsync(String, String, CancellationToken)

Declaration
public Task PublishAsync(string topic, string message, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String topic
String message
CancellationToken cancel
Returns
Type Description
Task
| Improve this Doc View Source

StartAsync()

Start the service.

Declaration
public Task StartAsync()
Returns
Type Description
Task
| Improve this Doc View Source

StopAsync()

Stop the service.

Declaration
public Task StopAsync()
Returns
Type Description
Task
| Improve this Doc View Source

SubscribeAsync(String, Action<IPublishedMessage>, CancellationToken)

Declaration
public Task SubscribeAsync(string topic, Action<IPublishedMessage> handler, CancellationToken cancellationToken)
Parameters
Type Name Description
String topic
Action<IPublishedMessage> handler
CancellationToken cancellationToken
Returns
Type Description
Task
| Improve this Doc View Source

SubscribedTopicsAsync(CancellationToken)

Declaration
public Task<IEnumerable<string>> SubscribedTopicsAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
CancellationToken cancel
Returns
Type Description
Task<IEnumerable<String>>

Implements

IService
IPubSubApi
  • Improve this Doc
  • View Source
Back to top Generated by DocFX