package capnp-rpc-lwt

  1. Overview
  2. Docs
class type 'a persistent = object ... end
val with_persistence : 'a persistent -> ('impl -> 'a Capability.t) -> {Untyped}1.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.

val with_sturdy_ref : 'a Sturdy_ref.t -> ('impl -> 'a Capability.t) -> {Untyped}1.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.

val save : 'a Capability.t -> (Uri.t, Capnp_rpc.Error.t) Stdlib.result Lwt.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.

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

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

OCaml

Innovation. Community. Security.