package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val dispatcher : ?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.

val poll : (module Bonsai.Model with type t = 'query) -> (module Bonsai.Model with type t = 'response) -> ?clear_when_deactivated:bool -> ('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.

val shared_poller : ('query, _) Bonsai.comparator -> (module Bonsai.Model with type t = 'response) -> ?clear_when_deactivated:bool -> ('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
OCaml

Innovation. Community. Security.