Module P2p_poldercast_lwt.Make

Functor building an implementation of Poldercast with Lwt given a FIXME Node_id, Node, gossip View, PolderCast Gossip protocol, and an Io event handler module.

Parameters

Signature

type t
type nid
type gid
type node
type group
type view
type mid
type ring
type ring_io
val init : me:node -> max_subs:int -> view_len:int -> xchg_len:int -> period:float -> fanout:int -> seen_len:int -> sub_list:(group * view) list -> stop:unit Lwt.t option -> io:(group -> ring_io) -> t

init node view view_len xchg_len period fanout seen_cap initializes a PolderCast 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

parameter stop

thread that shuts down all groups when cancelled

val run : t -> unit Lwt.t

run t returns a promise that is fulfilled upon shutdown

val shutdown : t -> unit

shutdown t shuts down all subscribed groups.

After calling this function, sub cannot be called again with t.

val sub : view:view -> t -> group -> t

sub ?view t group subscribes to group with initial view

val unsub : t -> gid -> (t, string) Stdlib.result

unsub t gid unsubscribes from group with ID gid

val find : t -> gid -> ring option
val view : t -> view

view t returns the combined view of all subscribed groups

val to_list : t -> (group * view) list

to_list t returns a list of (group, view) pairs of all subscribed groups paired with their current membership view