gaato/discord/coordinator does not have a README file

CoordinatorError

pub(all) suberror CoordinatorError {
InvalidConfig(message~ : String)
Transport(message~ : String)
Disconnected
InvalidResponse(message~ : String)
Remote(message~ : String)
} derive(
Debug
)

Failures reported by the coordinator server or a remote client.

Coordinator

pub struct Coordinator {
// private fields
}

A lightweight TCP coordinator shared by multiple bot processes.

Coordinator::addr

fn Coordinator::addr(self : Coordinator) -> String

Return the actual listening address, including an OS-assigned port.

Coordinator::close

fn Coordinator::close(self : Coordinator) -> Unit

Stop accepting clients and close active coordinator connections.

Shutdown cancels the internal task group; cancellation wakes every connection handler, and run_forever then closes each client socket and the listener itself (its documented contract forbids closing them here).

Coordinator::serve

async fn[X] Coordinator::serve(group :
TaskGroup
[X], addr~ : String, max_concurrency? : Int, identify_spacing_ms? : Int, global_limit? : Int) -> Coordinator

Start a JSON-lines coordinator in group.

Use port zero in addr to let the OS choose a free port, then pass coordinator.addr() to remote clients.

RemoteIdentifyQueue

pub struct RemoteIdentifyQueue {
// private fields
}

Cross-process implementation of IdentifyQueue.

RemoteIdentifyQueue::close

fn RemoteIdentifyQueue::close(self : RemoteIdentifyQueue) -> Unit

Close the coordinator connection; in-flight and later requests fail.

RemoteIdentifyQueue::connect

async fn RemoteIdentifyQueue::connect(addr : String) -> RemoteIdentifyQueue

Open the initial coordinator connection.

Later transport failures reconnect automatically with bounded backoff.

RemoteIdentifyQueue::ping

async fn RemoteIdentifyQueue::ping(self : RemoteIdentifyQueue) -> Unit

Round-trip a ping through the coordinator to verify connectivity.

RemoteRateLimiter

pub struct RemoteRateLimiter {
// private fields
}

Cross-process implementation of RateLimiter.

RemoteRateLimiter::close

fn RemoteRateLimiter::close(self : RemoteRateLimiter) -> Unit

Close both coordinator connections; in-flight and later requests fail.

RemoteRateLimiter::connect

async fn RemoteRateLimiter::connect(addr : String) -> RemoteRateLimiter

Open the initial coordinator connections.

Later transport failures reconnect automatically with bounded backoff.

RemoteRateLimiter::ping

async fn RemoteRateLimiter::ping(self : RemoteRateLimiter) -> Unit

Round-trip a ping through the coordinator to verify connectivity.