import { RangeMessenger } from "https://deno.land/x/range_reconcile@0.1.2/mod.ts";
Produces and responds to messages, enabling efficient reconciliation of two sets.
Constructors
Properties
A collated payload object created from many previous payload messages.
Indicates if we are done judging from received messages from the current round of messages.
The last upper bound of a series of adjacent 'done' messages, used to consolidate multiple done messages into a single one.
The lower bound of the next message, derived from the upper bound of the previous call to respond.
A tree returned by the previous call of tree.getFingeprint, to be used by the next call to .respond
.
Methods
Determine if reconciliation has been achieved by looking at messages.
Consolidate many adjacent done messages into a single done message, with the upper bound of the last one.
Decodes an incoming message, and remembers its upper bound to use as a lower bound for the next message.
Formulate the reply to a given message, as well as carry out any side effects such as inserting items into the tree.
A tiny convenience for casting the reusable tree to the right type.
Returns the opening messages for initiating an exchange between two peers.
Formulates and returns the appropriate response given a message from another peer. May insert values into the RangeMessenger's tree.
This method must be called with the messages from another peer, in the order they came.