package capnp-rpc

  1. Overview
  2. Docs
Module type
Class type

The result of a call, which may not have arrived yet. It can be used to pipeline calls to capabilities that we hope will be returned in the results.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.


Innovation. Community. Security.