3

I would like to use the WAMP protocol for RPC and Pub/Sub using websockets. In particular, I am interested in using crossbar.io as a WAMP server.

I read through the spec for WAMP and it was not clear whether it's possible to stream data as part of an RPC call from the client. There seems to be support for streaming a result from the server though.

edit: I want to clarify that I am referring to what one might call a progressive request as opposed to simply a server acting as a client.

oberstet
  • 21,353
  • 10
  • 64
  • 97
jedesah
  • 2,983
  • 2
  • 17
  • 29

4 Answers4

2

Server and client are equals in WAMP. A client in the classical sense (e.g. a browser) can offer a procedure for the server in the classical sense to call, and this can use progressive call results.

gzost
  • 2,375
  • 1
  • 18
  • 25
  • Sure, but my question is can the browser or some other client initiate a call with a stream of data, such as audio for instance? Furthermore, can the server in this instance provide progressive results based on a progressive request? – jedesah May 21 '15 at 16:03
2

Today (2015/05), WAMP has progressive results, but not progressive requests.

Development of WAMP was (well, still is) driven by use cases. We had a use case for progressive results, but not progressive requests. Also, it's not fully immediate how progressive requests should work.

oberstet
  • 21,353
  • 10
  • 64
  • 97
  • 1
    Could you expand upon your remark that the meaning of progressive request is not immediate? Would you be open to discussing our use case, perhaps offline? – jedesah May 22 '15 at 18:36
0

You should be able to simulate this fairly easily by simply making multiple calls and using some kind of sequencing/chunking to split up the data across multiple calls. Alternatively you could also call the intended recipient to let them know that data is ready and then have the recipient initiate a call and then utilize progressive call results.

Chappelle
  • 65
  • 2
  • 9
0

WAMP does not support this. I wrote the RPEP protocol for this and other reasons. RPEP has three modes a pub/sub mode (called "fireAndForget"), a normal RPC mode, and an even streaming mode. In the 3rd mode, you call a command and the command returns a stream that emits events. There is an implementation for javascript (web and node.js) here: https://github.com/Tixit/rpep.js

B T
  • 57,525
  • 34
  • 189
  • 207