Closed goeddea closed 10 years ago
Above is easy to do and useful. So we probably should add it.
A question is if we want to do it based on strings
session.prefix("api", "com.myapp.api");
session.call("api:get_events").then(...);
or like this:
session.prefix()
session.call.api.get_events().then(...);
Another option would be with WAMP Reflection. The latter allows a client to query for available procedures and topics.
The first variant keeps with the syntax for non-prefixed calls, while the second introduces a new syntax.
This by itself seems already unnecessary.
Additionally, in actual use, for publications and subscriptions, the first notation feels more natural when assembling a string for the action, e.g.
session.publish("api:sensor_activated." + sensorID)
vs.
session.publish.api["sensor_activated." + sensorID]
While with WAMP v2 there are no prefixes on the wire anymore, something like
session.prefix("api", "com.myapp.api"); session.call("api:get_events").then(...)
is nicer to write and read thanvar apiBaseUri = "com.myapp.api."; session.call(apiBaseUri + "get_events").then(...)