package capnp-rpc-net

  1. Overview
  2. Docs
type t

A user-provided function to restore services from persistent storage.

val hash : t -> Auth.hash

hash t is the hash to apply to a Restorer.Id.t to get the storage key, which is passed to load. You should use the hash id value to find the item. Note that hash is purely a local security measure - remote peers only see the ID.

val make_sturdy : t -> Id.t -> Uri.t

make_sturdy t id converts an ID to a full URI, by adding the hosting vat's address and fingerprint.

val load : t -> 'a Capnp_rpc_lwt.Sturdy_ref.t -> string -> resolution Lwt.t

load t sr digest is called to restore the service with key digest. sr is a sturdy ref that refers to the service, which the service might want to hand out to clients. Note that connecting to sr will block until the loader has returned. The result is cached until its ref-count reaches zero, so the table will never allow two live capabilities for a single Id.t at once. It will also not call load twice in parallel for the same digest.

OCaml

Innovation. Community. Security.