StandardActor

s2a.leucine.actors.StandardActor
abstract class StandardActor[ML <: Letter, SD <: Actor](prename: String)(using val context: ActorContext) extends BareActor

The StandardActor is able to respond to messages, but does not keep state. You can of course keep your own in var's. If you do, make sure these are private, so there is no risk the leak to the outside world. All possible return types must be specified. If no name is given, an unique name is generated, but the actor is not indexed to be retrieved on the base of its name. Supply !# as name to define this a worker actor.

Attributes

Graph
Supertypes
class BareActor
trait NameActor
trait UserActor
trait Actor
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Inherited classlikes

trait StashOps

Attributes

Inherited from:
StashDefs (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Stash.type

Types

type Sender = SD

All actors that may send messages to this actor. Note, you may always send a message to yourself.

All actors that may send messages to this actor. Note, you may always send a message to yourself.

Attributes

Inherited types

type Anonymous = Anonymous.type

Use this inside the actor to test for an anonymous sender

Use this inside the actor to test for an anonymous sender

Attributes

Inherited from:
BareActor

Value members

Concrete methods

def !(letter: MyLetter)(using sender: Sender): Unit

Send a letter with the 'tell' operator. For compatibility with Akka.

Send a letter with the 'tell' operator. For compatibility with Akka.

Attributes

def send(letter: MyLetter, sender: Sender): Boolean

Send a letter, with the option to say who is sending it. Defaults to anonymous outside the context of an actor and to self inside an actor. Returns if the letter was accepted for delivery. Note, this does not mean it also processed. In the mean time the actor may stop.

Send a letter, with the option to say who is sending it. Defaults to anonymous outside the context of an actor and to self inside an actor. Returns if the letter was accepted for delivery. Note, this does not mean it also processed. In the mean time the actor may stop.

Attributes

Inherited methods

See the current activity state of this actor

See the current activity state of this actor

Attributes

Inherited from:
StatusActor
def isWorker: Boolean

Values contains if this actor is a worker based on its name prefix (# per default)

Values contains if this actor is a worker based on its name prefix (# per default)

Attributes

Inherited from:
NameActor
protected def maxMailboxSize: Int

The maximum number of letters this actor accepts. Override to change its value.

The maximum number of letters this actor accepts. Override to change its value.

Attributes

Inherited from:
UserActor
def path: String

In the bare actor the path and name are equal.

In the bare actor the path and name are equal.

Attributes

Inherited from:
NameActor
final def stop(value: Stop): Unit

Stopping of an actor is organised in levels of sevirity. The lowest level (Direct) terminates directly, the highest level never terminates. The latter is the default. Levels can always be decreased, increase is only possible if the stop action was not yet started. Direct and Finish start immediately, and cannot be retracted.

Stopping of an actor is organised in levels of sevirity. The lowest level (Direct) terminates directly, the highest level never terminates. The latter is the default. Levels can always be decreased, increase is only possible if the stop action was not yet started. Direct and Finish start immediately, and cannot be retracted.

Attributes

Inherited from:
ControlActor
protected def stopped(cause: Stop, complete: Boolean): Unit

Called before actor deactivation and guaranteed after the last message is processed. If there were any unprocessed letters in this actor at teardown, complete is false. These could be in the normal mailbox or on the stash, if present. Cause returns the last stop mode, so the cause of stopping this actor is known. In case of a actorContext shutdown this is NOT called, for this disruptly terminates the processing loops. It is however called when stop(...) is used, or when the actor is shutdown by a parent. The actor may still be around after this method is called, but will never accept new messages. The parent is still defined, when stopped() is executed (but may already stopped processing messages) but all the childeren will already be removed from the list, and their stopped() methods have already been called.

Called before actor deactivation and guaranteed after the last message is processed. If there were any unprocessed letters in this actor at teardown, complete is false. These could be in the normal mailbox or on the stash, if present. Cause returns the last stop mode, so the cause of stopping this actor is known. In case of a actorContext shutdown this is NOT called, for this disruptly terminates the processing loops. It is however called when stop(...) is used, or when the actor is shutdown by a parent. The actor may still be around after this method is called, but will never accept new messages. The parent is still defined, when stopped() is executed (but may already stopped processing messages) but all the childeren will already be removed from the list, and their stopped() methods have already been called.

Attributes

Inherited from:
UserActor

Concrete fields

final val name: String

The final name of this actor. It will be the name given, or a generated name for unnamed actors and workers

The final name of this actor. It will be the name given, or a generated name for unnamed actors and workers

Attributes

Givens

Givens

Inherited givens

given given_: StandardActor[ML, SD]

Used as sender for all messages send from this actor without explicit sender.

Used as sender for all messages send from this actor without explicit sender.

Attributes

Inherited from:
BareActor