Module P2p_taps_lwt.Make
Functor building an implementation of Taps with Lwt given a Node_id, Node, gossip View, Taps implementation, and an Io event handler module.
Parameters
Node_id : P2p.S.NODE_IDNode : P2p.S.NODE with type nid := Node_id.tView : P2p.S.VIEW with type nid := Node_id.t and type node := Node.tTaps : P2p.S.GOSSIP with type node := Node.t and type view := View.tIo : S.TAPS_IO with type nid := Node_id.t and type node := Node.t and type view := View.t
Signature
val init : me:node -> view:view -> view_len:int -> xchg_len:int -> period:float -> io:io -> tinit node view view_len xchg_len period ioinitializes a TAPS instance- parameter me
this node
- parameter view
initial TAPS view
- parameter xview
explicit 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 io
network I/O implementation
val run : ?stop:unit Lwt.t -> t -> unit Lwt.trun truns initiator thread: picks a random node fromviewto gossip with everyperiodseconds.If
?stopis provided, this initiator thread returns as soon as thestopthread is fulfilled.
val shutdown : t -> unitshutdown tstops initiator thread.In case
runwas called with astopargument, thestopthread is cancelled, otherwise it is fulfilled.