package capnp-rpc-net

  1. Overview
  2. Docs

Module Restorer.TableSource

Sourcetype t

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

Sourceval 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.

Sourceval 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.

Sourceval add : t -> Id.t -> 'a Capnp_rpc_lwt.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).

Sourceval sturdy_ref : t -> Id.t -> 'a Capnp_rpc_lwt.Sturdy_ref.t

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

Sourceval 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.

Sourceval clear : t -> unit

clear t removes all entries from the table.