package capnp-rpc-lwt

  1. Overview
  2. Docs
type t

A restorer that keeps a hashtable mapping IDs to capabilities in memory.

val create : (Id.t -> Uri.t) -> t

create make_sturdy is a new in-memory-only table. make_sturdy id converts an ID to a full URI, by adding the hosting vat's address and fingerprint.

val of_loader : (module LOADER with type t = 'loader) -> 'loader -> t

of_loader (module Loader) l is a new caching table that uses Loader.load l sr (Loader.hash id) to restore services that aren't in the cache.

val add : t -> Id.t -> 'a Capability.t -> unit

add t id cap adds a mapping to t. It takes ownership of cap (it will call Capability.dec_ref cap on clear).

val sturdy_ref : t -> Id.t -> 'a Sturdy_ref.t

sturdy_ref t id is a sturdy ref that can be used to restore service id.

val remove : t -> Id.t -> unit

remove t id removes id from t. It decrements the capability's ref count if it was added manually with add.

val clear : t -> unit

clear t removes all entries from the table.