Class Act
Assembly: Akka.dll
Syntax
public sealed class Act : ReceiveActor, IInternalActor, IInitializableActor, IActorDsl
Constructors
|
Edit this page
View Source
Act(Action<IActorDsl, IActorContext>)
Declaration
public Act(Action<IActorDsl, IActorContext> config)
Parameters
|
Edit this page
View Source
Act(Action<IActorDsl>)
Declaration
public Act(Action<IActorDsl> config)
Parameters
Properties
|
Edit this page
View Source
OnPostRestart
Declaration
public Action<Exception, IActorContext>? OnPostRestart { get; set; }
Property Value
|
Edit this page
View Source
OnPostStop
Declaration
public Action<IActorContext>? OnPostStop { get; set; }
Property Value
|
Edit this page
View Source
OnPreRestart
Declaration
public Action<Exception, object, IActorContext>? OnPreRestart { get; set; }
Property Value
|
Edit this page
View Source
OnPreStart
Declaration
public Action<IActorContext>? OnPreStart { get; set; }
Property Value
|
Edit this page
View Source
Strategy
Declaration
public SupervisorStrategy? Strategy { get; set; }
Property Value
Methods
|
Edit this page
View Source
ActorOf(Action<IActorDsl>, string?)
Declaration
public IActorRef ActorOf(Action<IActorDsl> config, string? name = null)
Parameters
Returns
|
Edit this page
View Source
Become(Action<object, IActorContext>)
Changes the actor's behavior and replaces the current handler with the specified handler.
Declaration
public void Become(Action<object, IActorContext> handler)
Parameters
|
Edit this page
View Source
BecomeStacked(Action<object, IActorContext>)
Declaration
public void BecomeStacked(Action<object, IActorContext> handler)
Parameters
|
Edit this page
View Source
DefaultPostRestart(Exception)
Declaration
public void DefaultPostRestart(Exception reason)
Parameters
|
Edit this page
View Source
DefaultPostStop()
Declaration
public void DefaultPostStop()
|
Edit this page
View Source
DefaultPreRestart(Exception, object)
Declaration
public void DefaultPreRestart(Exception reason, object message)
Parameters
|
Edit this page
View Source
DefaultPreStart()
Declaration
public void DefaultPreStart()
|
Edit this page
View Source
PostRestart(Exception)
User overridable callback: By default it calls PreStart().
Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.
Declaration
protected override void PostRestart(Exception reason)
Parameters
| Type |
Name |
Description |
| Exception |
reason |
the Exception that caused the restart to happen.
|
Overrides
|
Edit this page
View Source
PostStop()
User overridable callback.
Is called asynchronously after 'actor.stop()' is invoked.
Empty default implementation.
Declaration
protected override void PostStop()
Overrides
|
Edit this page
View Source
PreRestart(Exception, object)
User overridable callback: '''By default it disposes of all children and then calls postStop().'''
Is called on a crashed Actor right BEFORE it is restarted to allow clean
up of resources before Actor is terminated.
Declaration
protected override void PreRestart(Exception reason, object message)
Parameters
| Type |
Name |
Description |
| Exception |
reason |
the Exception that caused the restart to happen.
|
| object |
message |
optionally the current message the actor processed when failing, if applicable.
|
Overrides
|
Edit this page
View Source
PreStart()
User overridable callback.
Is called when an Actor is started.
Actors are automatically started asynchronously when created.
Empty default implementation.
Declaration
protected override void PreStart()
Overrides
|
Edit this page
View Source
ReceiveAny(Action<object, IActorContext>)
Declaration
public void ReceiveAny(Action<object, IActorContext> handler)
Parameters
|
Edit this page
View Source
ReceiveAnyAsync(Func<object, IActorContext, Task>)
Registers an asynchronous handler for any incoming message that has not already been handled.
Declaration
public void ReceiveAnyAsync(Func<object, IActorContext, Task> handler)
Parameters
|
Edit this page
View Source
ReceiveAsync<T>(Func<T, IActorContext, Task>, Predicate<T>?)
Registers an async handler for messages of the specified type T
Declaration
public void ReceiveAsync<T>(Func<T, IActorContext, Task> handler, Predicate<T>? shouldHandle = null)
Parameters
| Type |
Name |
Description |
| Func<T, IActorContext, Task> |
handler |
the message handler invoked on the incoming message
|
| Predicate<T> |
shouldHandle |
when not null, determines whether this handler should handle the message
|
Type Parameters
| Name |
Description |
| T |
the type of the message
|
|
Edit this page
View Source
ReceiveAsync<T>(Predicate<T>, Func<T, IActorContext, Task>)
Registers an async handler for messages of the specified type T
Declaration
public void ReceiveAsync<T>(Predicate<T> shouldHandle, Func<T, IActorContext, Task> handler)
Parameters
| Type |
Name |
Description |
| Predicate<T> |
shouldHandle |
determines whether this handler should handle the message
|
| Func<T, IActorContext, Task> |
handler |
the message handler invoked on the incoming message
|
Type Parameters
|
Edit this page
View Source
Receive<T>(Action<T, IActorContext>)
Declaration
public void Receive<T>(Action<T, IActorContext> handler)
Parameters
Type Parameters
|
Edit this page
View Source
Receive<T>(Action<T, IActorContext>, Predicate<T>)
Declaration
public void Receive<T>(Action<T, IActorContext> handler, Predicate<T> shouldHandle)
Parameters
Type Parameters
|
Edit this page
View Source
Receive<T>(Predicate<T>, Action<T, IActorContext>)
Declaration
public void Receive<T>(Predicate<T> shouldHandle, Action<T, IActorContext> handler)
Parameters
Type Parameters
|
Edit this page
View Source
SupervisorStrategy()
Declaration
protected override SupervisorStrategy SupervisorStrategy()
Returns
Overrides
Implements
Extension Methods