Module Rpc_effect.RpcSource

Sourceval dispatcher : ?sexp_of_query:('query -> Core.Sexp.t) -> ?sexp_of_response:('response -> Core.Sexp.t) -> ('query, 'response) Async_rpc_kernel.Rpc.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 sending a particular RPC to a particular place.

Sourceval babel_dispatcher : ?sexp_of_query:('query -> Core.Sexp.t) -> ?sexp_of_response:('response -> Core.Sexp.t) -> ('query -> 'response Core.Or_error.t Async_kernel.Deferred.t) Babel.Caller.t -> where_to_connect:Where_to_connect.t -> ('query -> 'response Core.Or_error.t Bonsai.For_open.Effect.t) Bonsai.For_open.Computation.t
Sourceval streamable_dispatcher : ?sexp_of_query:('query -> Core.Sexp.t) -> ?sexp_of_response:('response -> Core.Sexp.t) -> ('query, 'response) Streamable.Plain_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
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) Async_rpc_kernel.Rpc.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 an RPC and keeps track of the most recent response. Only one request will be in-flight at any point in time.

clear_when_deactivated determines whether the most recent response should be discarded when the component is deactivated. Default is true.

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 Core.Or_error.t Async_kernel.Deferred.t) Babel.Caller.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

Analagous to poll for babel RPCs. See poll for details.

Sourceval streamable_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) Streamable.Plain_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

Analagous to poll for Streamable plain RPCs. See poll for details.

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) Async_rpc_kernel.Rpc.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
Sourceval poll_until_ok : ?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) Async_rpc_kernel.Rpc.Rpc.t -> where_to_connect:Where_to_connect.t -> retry_interval:Core.Time_ns.Span.t -> 'query Bonsai.For_open.Value.t -> ('query, 'response) Poll_result.t Bonsai.For_open.Computation.t

Like poll, but stops polling the same input query after an ok response. If the query changes, the computation will resume polling until it receives another ok response. If the computation receives an error response, it will retry sending the RPC after waiting retry_interval.

Sourceval babel_poll_until_ok : ?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 Core.Or_error.t Async_kernel.Deferred.t) Babel.Caller.t -> where_to_connect:Where_to_connect.t -> retry_interval:Core.Time_ns.Span.t -> 'query Bonsai.For_open.Value.t -> ('query, 'response) Poll_result.t Bonsai.For_open.Computation.t