是否可以使用 WAMP 进行流式 RPC 调用?

Is it possible to do a streaming RPC call using WAMP?

我想使用 WAMP protocol for RPC and Pub/Sub using websockets. In particular, I am interested in using crossbar.io 作为 WAMP 服务器。

我通读了 WAMP 的规范,不清楚是否可以将数据作为来自客户端的 RPC 调用的一部分进行流式传输。不过似乎有 support 用于从服务器流式传输结果。

编辑:我想澄清一下,我指的是所谓的渐进式请求,而不是简单地充当客户端的服务器。

服务器和客户端在 WAMP 中是平等的。经典意义上的客户端(例如浏览器)可以提供一个程序供经典意义上的服务器调用,这可以使用渐进式调用结果。

今天(2​​015/05),WAMP 有进步的结果,但没有进步的请求。

WAMP 的开发曾经(好吧,现在仍然)由用例驱动。我们有一个渐进式结果的用例,但没有渐进式请求。此外,渐进式请求的工作方式并不完全直接。

您应该能够通过简单地进行多次调用并使用某种 sequencing/chunking 将数据拆分到多个调用中来相当轻松地模拟这一点。或者,您也可以打电话给预期的接收者,让他们知道数据已准备就绪,然后让接收者发起呼叫,然后利用渐进式呼叫结果。

WAMP 不支持此功能。我写了 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