ClusterImpl

class ClusterImpl(nodes: List<ClusterNode>, val current: ClusterNode, val proxy: Boolean = false, val loggerFactory: Logger.Factory, val registry: ClusterActorRegistry, val routing: Routing.() -> Unit = {}, val serialization: SerializersModuleBuilder.() -> Unit = {}) : Cluster

Implementation of the Cluster interface for managing and orchestrating distributed systems.

This class is responsible for setting up the communication infrastructure, handling RPC, and managing lifecycle operations (startup, shutdown) across a cluster of nodes. It provides utilities for interacting with other nodes in the cluster, sending requests, and receiving responses in a structured manner.

Parameters

nodes

The list of ClusterNode instances representing all the nodes in the cluster.

current

The current node in the cluster, representing the local instance of this implementation.

proxy

Indicates whether the current node operates as a proxy; if true, it excludes the current node from the list of managed nodes.

loggerFactory

A factory for creating loggers used throughout the cluster implementation.

routing

A configuration block for setting up routing within the HTTP server.

serialization

A configuration block for customizing the serialization module.

Constructors

Link copied to clipboard
constructor(nodes: List<ClusterNode>, current: ClusterNode, proxy: Boolean = false, loggerFactory: Logger.Factory, registry: ClusterActorRegistry, routing: Routing.() -> Unit = {}, serialization: SerializersModuleBuilder.() -> Unit = {})

Creates a new instance of ClusterImpl with the specified parameters.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val proxy: Boolean = false
Link copied to clipboard
Link copied to clipboard
val routing: Routing.() -> Unit
Link copied to clipboard

Handles communication with other nodes in the cluster using remote procedure calls (RPC) over WebSocket.

Link copied to clipboard
val serialization: SerializersModuleBuilder.() -> Unit

Functions

Link copied to clipboard

Retrieves the RPC send service associated with a given address.

Link copied to clipboard
open override fun shutdown()

Shuts down the cluster and its associated components.

Link copied to clipboard
open override fun start(wait: Boolean)

Starts the cluster by initializing the HTTP client and HTTP server components.