Parameter Make.9-Ringcast_lwt
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 fromview
to gossip with everyperiod
seconds.If
?stop
is provided, this initiator thread returns as soon as thestop
thread is fulfilled.
val shutdown : t -> unit
shutdown t
stops initiator thread.In case
run
was called with astop
argument, thestop
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 asrc
node and selects nodes from the local view it should be forwarded to (predecessor or successor on the ring and some random nodes, limited byfanout
); callsIo.send_msg
for each selected node