cgmartin / clj-wamp

WebSocket Application Messaging Protocol (WAMP) for Clojure and HTTP Kit
http://cljwamp.us
Eclipse Public License 1.0
54 stars 12 forks source link

WAMP v2 support #13

Open aengelberg opened 9 years ago

aengelberg commented 9 years ago

My understanding is that WAMP RPC supports not only array params but also keyval params, passed at the same time during an RPC call. It looks like only array params are supported, but will keyvals be supported in the future?

I'm new to WAMP, so my apologies in advance if I have a fundamental misunderstanding of how the protocol (or this library) works.

Thanks! --Alex

aengelberg commented 9 years ago

As I've been working with Autobahn and clj-wamp more, I've run into this issue more commonly, so I investigated the issue more thoroughly. From the Autobahn source code:

Session.prototype.call = function (procedure, args, kwargs, options) { ... }

However, clj-wamp-example uses Autobahn's .call method like so:

$('#echo-btn').click(function() {
        sess.call("rpc:echo", 'test').then( ...

And clj-wamp uses the WAMP response like so:

(defn- on-call
  "Handle WAMP call (RPC) messages"
  [callbacks sess-id topic call-id & call-params]

Again, as I'm new at this I may have a misunderstanding of the WAMP specification and how flexible it is. However, this evidence leads me to believe that clj-wamp (and clj-wamp-example) is inconsistent with Autobahn in its WAMP specification concerning argument lists.

aengelberg commented 9 years ago

For that matter, I am also uncertain as to whether clj-wamp supports the "options" dict presumably inside RFC CALL arrays.

aengelberg commented 9 years ago

Looks like the reason behind all of this is that clj-wamp uses WAMP v1 whereas it's already on version 2.

Sorry for the confusion.

cgmartin commented 9 years ago

Hi @aengelberg, I hadn't heard about WAMP v2. Good to know.

I've moved on from this project and won't be adding v2 support, but I'm always open to Pull Requests or transferring ownership to a new maintainer. Cheers