autobahn-cpp
autobahn-cpp copied to clipboard
Progressive call results implementation is incomplete
There are no call options yet added for progressive call results as per the spec. I have a commit with the necessary changes. I should have a patch ready this week.
Nice! The other piece (besides options) missing is: have a function on the invocation details, so the callee can produce progressive call results. Eg:
- https://github.com/crossbario/autobahn-python/blob/master/examples/twisted/wamp/rpc/progress/backend.py#L46
- https://github.com/crossbario/autobahn-python/blob/master/examples/twisted/wamp/rpc/progress/backend.js#L22
We have an example for a JS caller invoking a C++ callee, where there latter produces progressive results:
- https://github.com/crossbario/autobahn-cpp/blob/master/examples/web/index.html#L34
- https://github.com/crossbario/autobahn-cpp/blob/master/examples/callee.cpp#L63
What is missing is the reverse: a C++ caller invoking a JS callee, where the latter produces progressive results. The JS side in there - the C++ bits are missing.
In Python, this looks like this:
def on_progress(i):
print("Progress: {}".format(i))
res = yield self.call(u'com.myapp.longop', 3, options=CallOptions(on_progress=on_progress))
We can use that as a model for C++ too. That is, we need a (templated) member in https://github.com/crossbario/autobahn-cpp/blob/master/autobahn/wamp_call_options.hpp for the user to provide a progressive result callback.