ClusterActorRef

class ClusterActorRef(address: Address, service: RpcSendService) : ActorRef

Represents a reference to an actor in a distributed cluster system.

This class is responsible for enabling communication with a remote actor residing on a node within a clustered environment. It interacts with the specified node using an RPC (Remote Procedure Call) service to send messages, query actor states, and manage actor lifecycle operations such as shutdown.

The ClusterActorRef acts as a proxy for the remote actor, abstracting the complexities of network communication and providing a unified interface for interaction.

Parameters

address

The network address of the actor within the cluster.

service

The RPC service used to communicate with the remote actor.

Constructors

Link copied to clipboard
constructor(address: Address, service: RpcSendService)

Creates a ClusterActorRef instance.

Properties

Link copied to clipboard

Functions

Link copied to clipboard

open suspend override fun <R : ActorProtocol.Response, M : ActorProtocol.Message<R>> ask(msg: M, timeout: Duration): Result<R>

Sends a message to the target actor and waits for a response within a specified timeout.

Link copied to clipboard
open suspend override fun shutdown(): Result<Unit>

Initiates a shutdown operation for the associated actor, sending a request to the actor's service and processing the response to determine the outcome of the operation.

Link copied to clipboard
open suspend override fun stats(): Result<Actor.Stats>

Retrieves statistical information about the actor.

Link copied to clipboard
open suspend override fun status(): Result<Actor.Status>

Retrieves the current status of the actor.

Link copied to clipboard
open suspend override fun tell(msg: ActorProtocol): Result<Unit>

Sends a message to the actor identified by the given address.

Link copied to clipboard
open override fun toString(): String

Provides a string representation of the ClusterActorRef instance.