Module P2p_tac_lwt.Make

Functor building an implementation of TAC with Lwt given a Node_id, Node, gossip View, Tac implementation, and an Io event handler module.

Parameters

Signature

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

init node view view_len xchg_len period io initializes a TAC instance

parameter me

this node

parameter view

initial TAC 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.t

run 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 src recvd merges received entries from a node and sends response

val view : t -> view

view t returns current view