Class ReceiveActor
TBD
Inheritance
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public abstract class ReceiveActor : UntypedActor, IInternalActor, IInitializableActor
Constructors
| Improve this Doc View SourceReceiveActor()
TBD
Declaration
protected ReceiveActor()
Methods
| Improve this Doc View SourceBecome(Action)
Changes the actor's behavior and replaces the current receive handler with the specified handler.
Declaration
protected void Become(Action configure)
Parameters
Type | Name | Description |
---|---|---|
Action | configure | Configures the new handler by calling the different Receive overloads. |
BecomeStacked(Action)
Changes the actor's behavior and replaces the current receive handler with the specified handler.
The current handler is stored on a stack, and you can revert to it by calling UnbecomeStacked()
Declaration
protected void BecomeStacked(Action configure)
Parameters
Type | Name | Description |
---|---|---|
Action | configure | Configures the new handler by calling the different Receive overloads. |
OnReceive(Object)
TBD
Declaration
protected sealed override void OnReceive(object message)
Parameters
Type | Name | Description |
---|---|---|
Object | message | TBD |
Overrides
| Improve this Doc View SourceReceive(Type, Action<Object>, Predicate<Object>)
Registers a handler for incoming messages of the specified messageType
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
Declaration
protected void Receive(Type messageType, Action<object> handler, Predicate<object> shouldHandle = null)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the message |
Action<Object> | handler | The message handler that is invoked for incoming messages of the specified |
Predicate<Object> | shouldHandle | When not |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception is thrown if this method is called outside of the actor's constructor or from Become(Action). |
Receive(Type, Func<Object, Boolean>)
Registers a handler for incoming messages of the specified messageType
.
The handler should return true
if it has handled the message.
If the handler returns true no more handlers will be tried; otherwise the next registered handler will be tried.
Declaration
protected void Receive(Type messageType, Func<object, bool> handler)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the message |
Func<Object, Boolean> | handler | The message handler that is invoked for incoming messages of the
specified type |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception is thrown if this method is called outside of the actor's constructor or from Become(Action). |
Receive(Type, Predicate<Object>, Action<Object>)
Registers a handler for incoming messages of the specified messageType
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
Declaration
protected void Receive(Type messageType, Predicate<object> shouldHandle, Action<object> handler)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the message |
Predicate<Object> | shouldHandle | When not |
Action<Object> | handler | The message handler that is invoked for incoming messages of the specified |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception is thrown if this method is called outside of the actor's constructor or from Become(Action). |
Receive<T>(Action<T>, Predicate<T>)
Registers a handler for incoming messages of the specified type T
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
Declaration
protected void Receive<T>(Action<T> handler, Predicate<T> shouldHandle = null)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | handler | The message handler that is invoked for incoming messages of the specified type |
Predicate<T> | shouldHandle | When not |
Type Parameters
Name | Description |
---|---|
T | The type of the message |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception is thrown if this method is called outside of the actor's constructor or from Become(Action). |
Receive<T>(Func<T, Boolean>)
Registers a handler for incoming messages of the specified type T
.
The handler should return true
if it has handled the message.
If the handler returns true no more handlers will be tried; otherwise the next registered handler will be tried.
Declaration
protected void Receive<T>(Func<T, bool> handler)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Boolean> | handler | The message handler that is invoked for incoming messages of the
specified type |
Type Parameters
Name | Description |
---|---|
T | The type of the message |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception is thrown if this method is called outside of the actor's constructor or from Become(Action). |
Receive<T>(Predicate<T>, Action<T>)
Registers a handler for incoming messages of the specified type T
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
Declaration
protected void Receive<T>(Predicate<T> shouldHandle, Action<T> handler)
Parameters
Type | Name | Description |
---|---|---|
Predicate<T> | shouldHandle | When not |
Action<T> | handler | The message handler that is invoked for incoming messages of the specified type |
Type Parameters
Name | Description |
---|---|
T | The type of the message |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception is thrown if this method is called outside of the actor's constructor or from Become(Action). |
ReceiveAny(Action<Object>)
Registers a handler for incoming messages of any type.
Declaration
protected void ReceiveAny(Action<object> handler)
Parameters
Type | Name | Description |
---|---|---|
Action<Object> | handler | The message handler that is invoked for all |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception is thrown if this method is called outside of the actor's constructor or from Become(Action). |
ReceiveAnyAsync(Func<Object, Task>)
Registers an asynchronous handler for incoming messages of any type.
handler
completes.
Declaration
protected void ReceiveAnyAsync(Func<object, Task> handler)
Parameters
Type | Name | Description |
---|---|---|
Func<Object, Task> | handler | The message handler that is invoked for all |
ReceiveAsync(Type, Func<Object, Task>, Predicate<Object>)
Registers an asynchronous handler for incoming messages of the specified messageType
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
handler
completes.
Declaration
protected void ReceiveAsync(Type messageType, Func<object, Task> handler, Predicate<object> shouldHandle = null)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the message |
Func<Object, Task> | handler | The message handler that is invoked for incoming messages of the specified |
Predicate<Object> | shouldHandle | When not |
ReceiveAsync(Type, Predicate<Object>, Func<Object, Task>)
Registers an asynchronous handler for incoming messages of the specified messageType
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
handler
completes.
Declaration
protected void ReceiveAsync(Type messageType, Predicate<object> shouldHandle, Func<object, Task> handler)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the message |
Predicate<Object> | shouldHandle | When not |
Func<Object, Task> | handler | The message handler that is invoked for incoming messages of the specified |
ReceiveAsync<T>(Func<T, Task>, Predicate<T>)
Registers an asynchronous handler for incoming messages of the specified type T
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
handler
completes.
Declaration
protected void ReceiveAsync<T>(Func<T, Task> handler, Predicate<T> shouldHandle = null)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task> | handler | The message handler that is invoked for incoming messages of the specified type |
Predicate<T> | shouldHandle | When not |
Type Parameters
Name | Description |
---|---|
T | The type of the message |
ReceiveAsync<T>(Predicate<T>, Func<T, Task>)
Registers an asynchronous handler for incoming messages of the specified type T
.
If shouldHandle
!=null
then it must return true before a message is passed to handler
.
handler
completes.
Declaration
protected void ReceiveAsync<T>(Predicate<T> shouldHandle, Func<T, Task> handler)
Parameters
Type | Name | Description |
---|---|---|
Predicate<T> | shouldHandle | When not |
Func<T, Task> | handler | The message handler that is invoked for incoming messages of the specified type |
Type Parameters
Name | Description |
---|---|
T | The type of the message |
Explicit Interface Implementations
| Improve this Doc View SourceIInitializableActor.Init()
Declaration
void IInitializableActor.Init()