package capnp-rpc
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Cap'n Proto is a capability-based RPC system with bindings for many languages
Install
dune-project
Dependency
Authors
Maintainers
Sources
capnp-rpc-2.1.2.tbz
sha256=ef3f64b22d90bfe87f96e751bc61d29646c970032803c4135bec8626aecf704d
sha512=41731da19a0ec67ae8d519f70ba95bae143493df64133965e9dfd9eb7ca33c745efa6047f8784689be6230a2fefd77649b61635e9b713366e42fd8e89ee07512
doc/src/capnp-rpc.proto/local_struct_promise.ml.html
Source file local_struct_promise.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44module Make (C : S.CORE_TYPES) = struct module Struct_proxy = Struct_proxy.Make(C) type target = { mutable blocking : C.struct_resolver list; (* Resolvers blocked on us *) pending: (C.struct_ref -> unit) Queue.t; } let local_promise () = object (self : _ #Struct_proxy.t) inherit [target] Struct_proxy.t { blocking = []; pending = Queue.create () } val name = "local-promise" method private do_pipeline target i results msg = (* We add an extra resolver here so that we can report [self] as the blocker. *) match results#set_blocker (self :> C.base_ref) with | Error `Cycle -> C.Request_payload.release msg; C.resolve_exn results (Exception.v "Attempt to use pipelined call's result as pipeline target!") | Ok () -> target.blocking <- results :: target.blocking; target.pending |> Queue.add (fun p -> let cap = p#cap i in cap#call results msg; C.dec_ref cap ) method pp_unresolved f _ = Fmt.string f "(unresolved)" method private on_resolve target x = List.iter (fun r -> r#clear_blocker) target.blocking; Queue.iter (fun fn -> fn x) target.pending method private send_cancel _ = () method field_sealed_dispatch _ _ = None end let make () = let p = local_promise () in (p :> C.struct_ref), p#resolver end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>