package capnp-rpc-lwt

  1. Overview
  2. Docs

Module Capnp_rpc_lwt.PersistenceSource

Sourceclass type 'a persistent = object ... end
Sourceval with_persistence : 'a persistent -> ('impl -> 'a Capability.t) -> (Untyped.generic_service as 'impl) -> 'a Capability.t

with_persistence persist Service.Foo.local obj is like Service.Foo.local obj, but the resulting service also handles the Cap'n Proto persistence protocol, using persist.

Sourceval with_sturdy_ref : 'a Sturdy_ref.t -> ('impl -> 'a Capability.t) -> (Untyped.generic_service as 'impl) -> 'a Capability.t

with_sturdy_ref sr Service.Foo.local obj is like Service.Foo.local obj, but responds to save calls by returning sr.

Sourceval save : 'a Capability.t -> (Uri.t, [> `Capnp of Capnp_rpc.Error.t ]) Lwt_result.t

save cap calls the persistent save method on cap. Note that not all capabilities can be saved. todo: this should return an 'a Sturdy_ref.t; see Sturdy_ref.reader.

Sourceval save_exn : 'a Capability.t -> Uri.t Lwt.t

save_exn is a wrapper for save that returns a failed thread on error.