Class ListenerSupport
This class adds IListeners capabilities to an actor.
note
ListenerReceive must be wired manually into the actor's OnReceive(Object) method.
Inherited Members
Namespace: Akka.Routing
Assembly: Akka.dll
Syntax
public class ListenerSupport
Fields
| Improve this Doc View SourceListeners
The collection of registered listeners that is listening for messages from an actor.
Declaration
protected readonly HashSet<IActorRef> Listeners
Field Value
Type | Description |
---|---|
HashSet<IActorRef> |
Properties
| Improve this Doc View SourceListenerReceive
Retrieves the wiring needed to implement listening functionality.
note
This needs to be chained into the actor's OnReceive(Object) method.
Declaration
public Receive ListenerReceive { get; }
Property Value
Type | Description |
---|---|
Receive |
Methods
| Improve this Doc View SourceAdd(IActorRef)
Adds the specified actor to the collection of registered listeners.
Declaration
public void Add(IActorRef actor)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | actor | The actor to add to the collection of registered listeners. |
Gossip(Object)
Sends the supplied message to all registered listeners.
note
Messages sent this way use NoSender as the sender.
Declaration
public void Gossip(object message)
Parameters
Type | Name | Description |
---|---|---|
Object | message | The message sent to all registered listeners. |
Gossip(Object, IActorRef)
Sends the supplied message to all registered listeners.
Declaration
public void Gossip(object message, IActorRef sender)
Parameters
Type | Name | Description |
---|---|---|
Object | message | The message sent to all registered listeners. |
IActorRef | sender | The actor that sends the message. |
Remove(IActorRef)
Removes the specified actor from the collection of registered listeners.
Declaration
public void Remove(IActorRef actor)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | actor | The actor to remove from the collection of registered listeners. |