123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100openCoreopenAsync_kerneltype'amessage_handler=Bigstring.t->pos:int->len:int->'amoduleHandler_result=struct(** Result of an [on_message] callback. We split the [Continue] and [Wait _] cases to
make it clear that [Continue] is the expected case. The implementation should be
optimized for this case. *)type'at=|Stopof'a|Continue|WaitofunitDeferred.tendmoduletypeReader=sigtypet[@@derivingsexp_of]valclose:t->unitDeferred.tvalis_closed:t->bool(** Start reading incoming messages and pass them to [on_message], until it returns
[Stop _].
[on_end_of_batch] is called after processing a batch of messages, before waiting for
the file descriptor to become readable again. *)valread_forever:t->on_message:(Bigstring.t->pos:int->len:int->'aHandler_result.t)->on_end_of_batch:(unit->unit)->('a,[`Eof|`Closed])Result.tDeferred.tendmoduleSend_result=structtypemessage_too_big={size:int;max_message_size:int}[@@derivingsexp_of]type'at=|Sentof'a|Closed|Message_too_bigofmessage_too_big[@@derivingsexp_of]endmoduletypeWriter=sigtypet[@@derivingsexp_of]valclose:t->unitDeferred.tvalis_closed:t->boolvalmonitor:t->Monitor.tvalbytes_to_write:t->int(** Becomes determined when it is no longer possible to send message using this writer,
for instance when the writer is closed or the consumer leaves.
The result of this function is cached by [Rpc.Transport] *)valstopped:t->unitDeferred.t(** [flushed t] returns a deferred that must become determined when all prior sent
messages are delivered.
It must be OK to call [flushed t] after [t] has been closed. *)valflushed:t->unitDeferred.t(** [ready_to_write t] becomes determined when it is a good time to send messages
again. Async RPC calls this function after sending a batch of messages, to avoid
flooding the transport.
Using [let ready_to_write = flushed] is an acceptable implementation. *)valready_to_write:t->unitDeferred.t(** All the following functions send exactly one message. *)valsend_bin_prot:t->'aBin_prot.Type_class.writer->'a->unitSend_result.tvalsend_bin_prot_and_bigstring:t->'aBin_prot.Type_class.writer->'a->buf:Bigstring.t->pos:int->len:int->unitSend_result.t(** Same as [send_bin_prot_and_bigstring] but the bigstring can't be modified until the
returned deferred becomes determined. This can be used to avoid copying the
bigstring. *)valsend_bin_prot_and_bigstring_non_copying:t->'aBin_prot.Type_class.writer->'a->buf:Bigstring.t->pos:int->len:int->unitDeferred.tSend_result.tend