Replies: 3 comments 2 replies
-
When publishing an event on a session, that session is - by default - excluded from receiving its own published events even when subscribed - it will however receive events published to that topic -- published from other sessions This default behavior may be changed by publishing with option Please see here for spec and example: |
Beta Was this translation helpful? Give feedback.
-
Because for PubSub, when subscribed, event payloads are received exactly with what was published, and hence if subscriber is the same as publisher, that is pointless. For RPC, when registered, invocation payloads are received exactly with what the caller started the call with, but the result (and side effects of executing the call) are not known before the call returns (later than call origin), regardless of whether the callee is identical with the caller or not. Of course the caller might as well had the callee called locally, without routing, but that's another aspect.
How does the example suggest that? But in any case, if this is confusing, the example should explicitly discuss the aspect to save user's scratching their head and wasting time;) PRs are welcome! Please also note that WAMP PubSub also includes even more powerful ways of restricting the set of subscribers: https://wamp-proto.org/wamp_latest_ietf.html#name-subscriber-black-and-whitel |
Beta Was this translation helpful? Give feedback.
-
sure! so the example should be changed to session.publish('com.myapp.hello', ['Hello, world!'], {}, {exclude_me: false}); |
Beta Was this translation helpful? Give feedback.
-
I was using your example from the README, but the example does not work as expected.
The
onevent
call back is not executed.It does only get called when the event is published from a other session. E.g.:
The example from the readme does not work.
Is this "as it should be" or a issue with autobhan.js?
But why does
call
work in a single session, but notpublish
?Beta Was this translation helpful? Give feedback.
All reactions