Swim.Cluster
swim · API reference
type t = {
protocol : Protocol.t;
sw : Eio.Switch.t;
net : [ `Generic ] Eio.Net.ty Eio.Resource.t;
}val create :
sw:Eio.Switch.t ->
env:
< clock : float Eio.Time.clock_ty Eio.Time.clock
; mono_clock : Eio.Time.Mono.ty Eio.Time.Mono.t
; net : [> [ `Generic ] Eio.Net.ty ] Eio.Net.t
; secure_random : Eio.Flow.source_ty Eio.Flow.source.. >
Types.env ->
config:Types.config ->
(t, [> `Invalid_key ]) resultval start : t -> unitval shutdown : t -> unitval local_node : t -> Types.node_infoval members : t -> Types.node_info listval member_count : t -> intval events : t -> Types.node_event Eio.Stream.tval stats : t -> Types.statsval add_member : t -> Types.node_info -> unitval remove_member : t -> Types.node_id -> boolval join :
t ->
seed_nodes:string list ->
(unit, [> `No_seeds_reachable ]) resultval broadcast : t -> topic:string -> payload:string -> unitval send :
t ->
target:Types.node_id ->
topic:string ->
payload:string ->
(unit, [> `Unknown_node ]) resultval send_to_addr :
t ->
addr:Eio.Net.Sockaddr.datagram ->
topic:string ->
payload:string ->
unitval on_message : t -> (Types.node_info -> string -> string -> unit) -> unitval is_alive : t -> Types.node_id -> boolval find_node : t -> Types.node_id -> Types.node_info optionval is_healthy : t -> bool