package rpc_parallel

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

Parameters

module M : Core.T1

Signature

type _ t =
  1. | Connection_closed : (connection_state_init_arg:S.Connection_state.init_arg -> Connection.t M.t Async.Deferred.t) t
  2. | Heartbeater_connection_timeout : worker M.t Async.Deferred.t t
  3. | Called_shutdown_function : worker M.t Async.Deferred.t t

This variant determines when a spawned worker will shut itself down.

In both the Connection_closed and Heartbeater_connection_timeout cases, the worker will shut itself down when Rpc.Connection.close_finished is determined on some established connection. The difference is which connection.

In the Connection_closed case, the connection is returned back to the caller. The caller can call Worker.Connection.close to cause worker shutdown. If you never intend to reconnect to your spawned worker, this is probably the variant you want to choose.

In the Heartbeater_connection_timeout case, the connection is internal to the library. The worker is returned so the caller is free to establish connections and close them without triggering worker shutdown.

In both the above cases, worker shutdown will be triggered when the master process exits. It may also result from network problems or long async cycles.

In the Called_shutdown_function case, the worker will only shut itself down on an explicit Worker.shutdown call. Worker's spawned with this variant do not shutdown when the master process exits. We strongly discourage use of this variant.

OCaml

Innovation. Community. Security.