Module PocketMeshPeer.PeersGroup

Module that represents one group of peers with its replicated content.

module Id: { ... };

ID of a group of peers.

type t;

Type for a group of peers.

let id: t => Id.t;

Returns ID of the group.

let alias: t => string;

Returns local alias of the group.

let content: t => Crdt.t;

Returns replicated data structure that stores application-specific content of the group.

let findPeerInGroupOpt: Peer.Id.t => t => option(PeerInGroup.t);

Tries to find a member of the group by its ID.

let foldPeersInGroup: ('acc => PeerInGroup.t => 'acc) => 'acc => t => 'acc;

foldPeersInGroup(f, acc, t) can be used to iterate through members of the group and accumulate a value.