Class Topic<T>
public sealed class Topic<T> : TopicBase, IDisposable
Type Parameters
T
- Inheritance
-
Topic<T>
- Implements
- Inherited Members
Properties
None
public static Topic<T> None { get; }
Property Value
- Topic<T>
Type
The message type for this topic.
public override Type Type { get; }
Property Value
Methods
Publish(EcsNode?, T)
Post a message on the topic.
public void Publish(EcsNode? sender, T details)
Parameters
sender
EcsNodeThe object sending the message.
details
TText details.
Subscribe(TopicHandler<T>)
Subscribe to the topic for all topics.
public void Subscribe(TopicHandler<T> handler)
Parameters
handler
TopicHandler<T>The callback delegate.
Subscribe(TopicHandler<T>, string)
Subscribe to the mailbox for all topics.
public void Subscribe(TopicHandler<T> handler, string topic)
Parameters
handler
TopicHandler<T>The callback delegate.
topic
stringThe topic to subscribe to.
Unsubscribe(TopicHandler<T>)
Unsubscribe an all subscriber.
public void Unsubscribe(TopicHandler<T> handler)
Parameters
handler
TopicHandler<T>The subscriber to remove.
Unsubscribe(TopicHandler<T>, string)
Unsubscribe a topic subscriber.
public void Unsubscribe(TopicHandler<T> handler, string topic)
Parameters
handler
TopicHandler<T>The subscriber to remove
topic
stringThe topic to unsubscribe from.