package bonsai

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Rpc_effect.Polling_state_rpcSource

Sourceval dispatcher : ?sexp_of_query:('query -> Core.Sexp.t) -> ?sexp_of_response:('response -> Core.Sexp.t) -> ?on_forget_client_error:(Core.Error.t -> unit Bonsai.For_open.Effect.t) -> ('query, 'response) Polling_state_rpc.t -> where_to_connect:Where_to_connect.t -> ('query -> 'response Core.Or_error.t Bonsai.For_open.Effect.t) Bonsai.For_open.Computation.t

An effect for dispatching on a particular Polling_state_rpc with a particular query. When the computation is deactivated, it asks the server to cleanup any cached data, so that there is no memory leak. If this cleanup fails, then on_forget_client_error is called with the error.

Sourceval babel_dispatcher : ?sexp_of_query:('query -> Core.Sexp.t) -> ?sexp_of_response:('response -> Core.Sexp.t) -> ?on_forget_client_error:(Core.Error.t -> unit Bonsai.For_open.Effect.t) -> ('query, 'response) Versioned_polling_state_rpc.Client.caller -> where_to_connect:Where_to_connect.t -> ('query -> 'response Core.Or_error.t Bonsai.For_open.Effect.t) Bonsai.For_open.Computation.t
Sourceval poll : ?sexp_of_query:('query -> Core.Sexp.t) -> ?sexp_of_response:('response -> Core.Sexp.t) -> equal_query:('query -> 'query -> bool) -> ?equal_response:('response -> 'response -> bool) -> ?clear_when_deactivated:bool -> ?on_response_received: ('query -> 'response Core.Or_error.t -> unit Bonsai.For_open.Effect.t) Bonsai.For_open.Value.t -> ('query, 'response) Polling_state_rpc.t -> where_to_connect:Where_to_connect.t -> every:Core.Time_ns.Span.t -> 'query Bonsai.For_open.Value.t -> ('query, 'response) Poll_result.t Bonsai.For_open.Computation.t

A computation that periodically dispatches on a polling_state_rpc and keeps track of the most recent response. To explicitly re-send the RPC, schedule the refresh field of the result. It also keeps track of the current query that is in-flight.

Sourceval babel_poll : ?sexp_of_query:('query -> Core.Sexp.t) -> ?sexp_of_response:('response -> Core.Sexp.t) -> equal_query:('query -> 'query -> bool) -> ?equal_response:('response -> 'response -> bool) -> ?clear_when_deactivated:bool -> ?on_response_received: ('query -> 'response Core.Or_error.t -> unit Bonsai.For_open.Effect.t) Bonsai.For_open.Value.t -> ('query, 'response) Versioned_polling_state_rpc.Client.caller -> where_to_connect:Where_to_connect.t -> every:Core.Time_ns.Span.t -> 'query Bonsai.For_open.Value.t -> ('query, 'response) Poll_result.t Bonsai.For_open.Computation.t
Sourceval shared_poller : ('query, _) Bonsai.comparator -> ?sexp_of_response:('response -> Core.Sexp.t) -> ?equal_response:('response -> 'response -> bool) -> ?clear_when_deactivated:bool -> ?on_response_received: ('query -> 'response Core.Or_error.t -> unit Bonsai.For_open.Effect.t) Bonsai.For_open.Value.t -> ('query, 'response) Polling_state_rpc.t -> where_to_connect:Where_to_connect.t -> every:Core.Time_ns.Span.t -> ('query, 'response) Shared_poller.t Bonsai.For_open.Computation.t