Parameter Make.9-Ringcast_lwt

type t
type nid
type node
type view
type mid
type io
val init : me:node -> view:view -> view_len:int -> xchg_len:int -> period:float -> fanout:int -> seen_len:int -> io:io -> t

init node view view_len xchg_len period fanout seen_cap initializes a RingCast instance with the following configuration.

parameter me

this node

parameter view

initial view

parameter view_len

max view length

parameter xchg_len

number of entries to exchange at each period

parameter period

gossip period, in seconds

parameter fanout

dissemination fanout

parameter seen_len

length of queue of last seen message IDs

val run : ?⁠stop:unit Lwt.t -> t -> unit Lwt.t

run ?stop t runs initiator thread: picks a random node from view to gossip with every period seconds.

If ?stop is provided, this initiator thread returns as soon as the stop thread is fulfilled.

val shutdown : t -> unit

shutdown t stops initiator thread.

In case run was called with a stop argument, the stop thread is cancelled, otherwise it is fulfilled.

val respond : t -> node -> view -> view Lwt.t

respond t node recvd merges received entries from a node and sends response

val forward : t -> node -> mid -> Cstruct.t -> unit Lwt.t

forward t src mid msg receives a message (msgid, msg) from a src node and selects nodes from the local view it should be forwarded to (predecessor or successor on the ring and some random nodes, limited by fanout); calls Io.send_msg for each selected node

val view : t -> view

view t returns current view