CellWrapper

org.apache.pekko.actor.instrumentation.CellWrapper
class CellWrapper(val underlying: Cell)

Thin wrapper used while exchanging an UnstartedCell for a real ActorCell instance. This wrapper is only meant to be used during the execution of UnstartedCell.replaceWith(...), for the sole purpose of ensuring that all messages that might have been accumulated in the UnstartedCell will get their Context propagated as expected.

For reference, we used to have a copy/pasted and modified version of UnstartedCell.replaceWith(...) as part of the instrumentation, but there were tiny bugs related to accessing internal state on the UnstartedCell while running our modified version of the method. These bugs lead to losing System Messages in certain situations, which eventually leads to actors not being shut down. The CellWrapper approach ensures that the internal calls to UnstartedCell.replaceWith#drainSysmsgQueue() are unchanged, while still ensuring that the Kamon Context will be propagated for all queued messages.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def childrenRefs: ChildrenContainer

All children of this actor, including only reserved-names.

All children of this actor, including only reserved-names.

Attributes

Definition Classes
Cell
override def getChildByName(name: String): Option[ChildStats]

Get the stats for the named child, if that exists.

Get the stats for the named child, if that exists.

Attributes

Definition Classes
Cell
override def getSingleChild(name: String): InternalActorRef

Method for looking up a single child beneath this actor. It is racy if called from the outside.

Method for looking up a single child beneath this actor. It is racy if called from the outside.

Attributes

Definition Classes
Cell
override def hasMessages: Boolean

If the actor isLocal, returns whether "user messages" are currently queued, “false” otherwise.

If the actor isLocal, returns whether "user messages" are currently queued, “false” otherwise.

Attributes

Definition Classes
Cell
override def isLocal: Boolean

Returns true if the actor is local, i.e. if it is actually scheduled on a Thread in the current JVM when run.

Returns true if the actor is local, i.e. if it is actually scheduled on a Thread in the current JVM when run.

Attributes

Definition Classes
Cell
override def numberOfMessages: Int

If the actor isLocal, returns the number of "user messages" currently queued, which may be a costly operation, 0 otherwise.

If the actor isLocal, returns the number of "user messages" currently queued, which may be a costly operation, 0 otherwise.

Attributes

Definition Classes
Cell
override def parent: InternalActorRef

The supervisor of this actor.

The supervisor of this actor.

Attributes

Definition Classes
Cell
override def props: Props

The props for this actor cell.

The props for this actor cell.

Attributes

Definition Classes
Cell
override def restart(cause: Throwable): Unit

Restart this actor (will recursively restart or stop all children). Is only allowed to throw Fatal Throwables.

Restart this actor (will recursively restart or stop all children). Is only allowed to throw Fatal Throwables.

Attributes

Definition Classes
Cell
override def resume(causedByFailure: Throwable): Unit

Recursively resume this actor and all its children. Is only allowed to throw Fatal Throwables.

Recursively resume this actor and all its children. Is only allowed to throw Fatal Throwables.

Attributes

Definition Classes
Cell
override def self: ActorRef

The “self” reference which this Cell is attached to.

The “self” reference which this Cell is attached to.

Attributes

Definition Classes
Cell
override def sendMessage(msg: Envelope): Unit

Enqueue a message to be sent to the actor; may or may not actually schedule the actor to run, depending on which type of cell it is. Is only allowed to throw Fatal Throwables.

Enqueue a message to be sent to the actor; may or may not actually schedule the actor to run, depending on which type of cell it is. Is only allowed to throw Fatal Throwables.

Attributes

Definition Classes
Cell
override def sendSystemMessage(msg: SystemMessage): Unit

Enqueue a message to be sent to the actor; may or may not actually schedule the actor to run, depending on which type of cell it is. Is only allowed to throw Fatal Throwables.

Enqueue a message to be sent to the actor; may or may not actually schedule the actor to run, depending on which type of cell it is. Is only allowed to throw Fatal Throwables.

Attributes

Definition Classes
Cell
override def start(): CellWrapper.this.type

Start the cell: enqueued message must not be processed before this has been called. The usual action is to attach the mailbox to a dispatcher.

Start the cell: enqueued message must not be processed before this has been called. The usual action is to attach the mailbox to a dispatcher.

Attributes

Definition Classes
Cell
override def stop(): Unit

Recursively terminate this actor and all its children. Is only allowed to throw Fatal Throwables.

Recursively terminate this actor and all its children. Is only allowed to throw Fatal Throwables.

Attributes

Definition Classes
Cell
override def suspend(): Unit

Recursively suspend this actor and all its children. Is only allowed to throw Fatal Throwables.

Recursively suspend this actor and all its children. Is only allowed to throw Fatal Throwables.

Attributes

Definition Classes
Cell
override def system: ActorSystem

The system within which this Cell lives.

The system within which this Cell lives.

Attributes

Definition Classes
Cell
override def systemImpl: ActorSystemImpl

The system internals where this Cell lives.

The system internals where this Cell lives.

Attributes

Definition Classes
Cell

Inherited methods

@InternalStableApi
final def sendMessage(message: Any, sender: ActorRef): Unit

Enqueue a message to be sent to the actor; may or may not actually schedule the actor to run, depending on which type of cell it is. Is only allowed to throw Fatal Throwables.

Enqueue a message to be sent to the actor; may or may not actually schedule the actor to run, depending on which type of cell it is. Is only allowed to throw Fatal Throwables.

Attributes

Inherited from:
Cell (hidden)

Concrete fields

val underlying: Cell