C# Класс Akka.Actor.ActorBase

Class ActorBase.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Become void
Clear void
Unbecome void
Unclear void

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
Become ( Receive receive, bool discardOld = true ) : void
Clear ( IActorRef self ) : void
Unbecome ( ) : void
Unclear ( ) : void

Описание методов

ActorBase() защищенный Метод

Initializes a new instance of the ActorBase class.
Do not create actors using 'new', always create them using an ActorContext/System
protected ActorBase ( ) : System
Результат System

AroundReceive() защищенный Метод

protected AroundReceive ( Receive receive, object message ) : bool
receive Receive
message object
Результат bool

Become() защищенный Метод

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.
Результат void

BecomeStacked() защищенный Метод

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.
Результат void

Receive() защищенный абстрактный Метод

Processor for user defined messages.
protected abstract Receive ( object message ) : bool
message object The message.
Результат bool

SetReceiveTimeout() защищенный Метод

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.
Результат void

UnbecomeStacked() защищенный Метод

Reverts the Actor behavior to the previous one on the behavior stack.
protected UnbecomeStacked ( ) : void
Результат void

Unhandled() защищенный Метод

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.
Результат void