package capnp-rpc
Cap'n Proto is a capability-based RPC system with bindings for many languages
Install
Dune Dependency
Authors
Maintainers
Sources
capnp-rpc-2.1.tbz
sha256=4b59a4147cf6e49c650dbfa4cdb918aec3be69cffd1ef6b5c818584464feb987
sha512=69114597e9cd8ad42c72c1751796b216f98f2a9f09f50a0628b4a3259c2f9b169fd47a73be7b76cfda298a6c202bc79762116865272e35ca0d0914242ace34d7
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 44
module 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)"
>