class
Movie::Remote::StripedConnectionPool
- Movie::Remote::StripedConnectionPool
- Reference
- Object
Overview
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.
Defined in:
movie/remote/connection_pool.crConstant Summary
-
DEFAULT_STRIPE_COUNT =
8 -
Default number of parallel connections (should match CPU cores)
-
Log =
::Log.for(self)
Constructors
Instance Method Summary
- #address : Address
-
#close
Closes all connections.
-
#connect : Bool
Connects all stripes in parallel.
- #connected? : Bool
-
#connection_for(actor_path : ActorPath) : Connection
Returns the connection for a specific actor path.
-
#connection_for(path_str : String) : Connection
Returns the connection for a path string.
-
#next_connection : Connection
Returns the next connection in round-robin order.
-
#send(envelope : WireEnvelope) : Bool
Sends an envelope through the appropriate stripe based on target path.
- #send_control(envelope : WireEnvelope) : Bool
-
#send_round_robin(envelope : WireEnvelope) : Bool
Sends an envelope through a specific stripe (for load balancing).
-
#stats : PoolStats
Returns connection statistics.
- #stopped? : Bool
-
#stripe(index : Int32) : Connection
Returns a specific stripe by index.
- #stripe_count : Int32
Constructor Detail
Instance Method Detail
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).
Returns the next connection in round-robin order. Use for messages where ordering doesn't matter.
Sends an envelope through the appropriate stripe based on target path.
Sends an envelope through a specific stripe (for load balancing).