You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've followed the tutorial in the README, and am trying to adapt it to define a schema that has a Connection.create method which returns a Connection.Stream:
My create implementation instantiates a Stream and returns it as a result:
method create_impl _params release_param_caps =
let open Connection.Create in
release_param_caps ();
let stream = Stream.local in
let response, results = Service.Response.create Results.init_pointer in
Results.stream_set results (Some stream);
Service.return response
The client calls this with:
let create t =
let open Api.Client.Connection.Create in
let request, _params = Capability.Request.create Params.init_pointer in
Capability.call_for_value_exn t method_id request |> Results.stream_get
However when I try to use the resulting Capability.t stream I get the exception: Invalid capability index!.
I've checked the reference counting, and it appears to be 2 after Results.stream_set results (Some stream);.
The full example can be found here, with the relevant files being:
Not had a chance to look at your code yet, but here's an older repository that has a similar setup (client/server+callbacks) that did work a few years ago https://github.com/ocurrent/ocluster/tree/prototype
I've followed the tutorial in the README, and am trying to adapt it to define a schema that has a
Connection.create
method which returns aConnection.Stream
:My
create
implementation instantiates aStream
and returns it as a result:The client calls this with:
However when I try to use the resulting
Capability.t stream
I get the exception:Invalid capability index!
.I've checked the reference counting, and it appears to be 2 after
Results.stream_set results (Some stream);
.The full example can be found here, with the relevant files being:
The output of which is:
Does the capability need to be a sturdy ref in order to be passed to the client?
I'm using the EIO port.
The text was updated successfully, but these errors were encountered: