class

Movie::Remote::StripedConnectionPool

Inherits Reference < Object

StripedConnectionPool maintains multiple parallel connections to a remote system. Actors are deterministically mapped to connections to preserve message ordering while enabling parallel sending across different actors.

Constants

DEFAULT_STRIPE_COUNT = 8

Default number of parallel connections (should match CPU cores)

Log = ::Log.for(self)

Constructors

new(address : Address, path_registry : Movie::PathRegistry, system : Movie::AbstractActorSystem, stripe_count : Int32 = DEFAULT_STRIPE_COUNT, on_message : Proc(WireEnvelope, Nil) | Nil = nil)
Source

Instance methods

address
Source
close

Closes all connections.

Source
connect

Connects all stripes in parallel. Returns true if all connections succeeded.

Source
connected?
Source
connection_for(actor_path : ActorPath) : Connection

Returns the connection for a specific actor path. Uses consistent hashing to ensure messages to the same actor always go through the same connection (preserving order).

Source
connection_for(path_str : String) : Connection

Returns the connection for a path string.

Source
next_connection

Returns the next connection in round-robin order. Use for messages where ordering doesn't matter.

Source
send(envelope : WireEnvelope) : Bool

Sends an envelope through the appropriate stripe based on target path.

Source
send_round_robin(envelope : WireEnvelope) : Bool

Sends an envelope through a specific stripe (for load balancing).

Source
stats

Returns connection statistics.

Source
stripe(index : Int32) : Connection

Returns a specific stripe by index.

Source
stripe_count
Source