C# Class Akka.Actor.ActorBase

Class ActorBase.
Mostra file Open project: rogeralsing/akka.net Class Usage Examples

Private Properties

Property Type Description
Become void
Clear void
Unbecome void
Unclear void

Protected Methods

Method Description
ActorBase ( ) : System

Initializes a new instance of the ActorBase class.

AroundReceive ( Receive receive, object message ) : bool
Become ( Receive receive ) : void

Changes the actor's command behavior and replaces the current receive handler with the specified handler.

BecomeStacked ( Receive receive ) : void

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 IActorContext.UnbecomeStacked Please note, that in order to not leak memory, make sure every call to BecomeStacked is matched with a call to IActorContext.UnbecomeStacked.

Receive ( object message ) : bool

Processor for user defined messages.

SetReceiveTimeout ( TimeSpan timeout ) : void

Defines the inactivity timeout after which the sending of a ReceiveTimeout message is triggered. When specified, the receive function should be able to handle a ReceiveTimeout message.

Please note that the receive timeout might fire and enqueue the ReceiveTimeout message right after another message was enqueued; hence it is not guaranteed that upon reception of the receive timeout there must have been an idle period beforehand as configured via this method.

Once set, the receive timeout stays in effect (i.e. continues firing repeatedly after inactivity periods). Pass in null to switch off this feature.

UnbecomeStacked ( ) : void

Reverts the Actor behavior to the previous one on the behavior stack.

Unhandled ( object message ) : void

Is called when a message isn't handled by the current behavior of the actor by default it fails with either a DeathPactException (in case of an unhandled Terminated message) or publishes an UnhandledMessage to the actor's system's EventStream

Private Methods

Method Description
Become ( Receive receive, bool discardOld = true ) : void
Clear ( IActorRef self ) : void
Unbecome ( ) : void
Unclear ( ) : void

Method Details

ActorBase() protected method

Initializes a new instance of the ActorBase class.
Do not create actors using 'new', always create them using an ActorContext/System
protected ActorBase ( ) : System
return System

AroundReceive() protected method

protected AroundReceive ( Receive receive, object message ) : bool
receive Receive
message object
return bool

Become() protected method

Changes the actor's command behavior and replaces the current receive handler with the specified handler.
protected Become ( Receive receive ) : void
receive Receive The new message handler.
return void

BecomeStacked() protected method

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 IActorContext.UnbecomeStacked Please note, that in order to not leak memory, make sure every call to BecomeStacked is matched with a call to IActorContext.UnbecomeStacked.
protected BecomeStacked ( Receive receive ) : void
receive Receive The new message handler.
return void

Receive() protected abstract method

Processor for user defined messages.
protected abstract Receive ( object message ) : bool
message object The message.
return bool

SetReceiveTimeout() protected method

Defines the inactivity timeout after which the sending of a ReceiveTimeout message is triggered. When specified, the receive function should be able to handle a ReceiveTimeout message.

Please note that the receive timeout might fire and enqueue the ReceiveTimeout message right after another message was enqueued; hence it is not guaranteed that upon reception of the receive timeout there must have been an idle period beforehand as configured via this method.

Once set, the receive timeout stays in effect (i.e. continues firing repeatedly after inactivity periods). Pass in null to switch off this feature.

protected SetReceiveTimeout ( TimeSpan timeout ) : void
timeout TimeSpan The timeout. Pass in null to switch off this feature.
return void

UnbecomeStacked() protected method

Reverts the Actor behavior to the previous one on the behavior stack.
protected UnbecomeStacked ( ) : void
return void

Unhandled() protected method

Is called when a message isn't handled by the current behavior of the actor by default it fails with either a DeathPactException (in case of an unhandled Terminated message) or publishes an UnhandledMessage to the actor's system's EventStream
protected Unhandled ( object message ) : void
message object The unhandled message.
return void