voryx / ThruwaySubscriptionMeta

Subscription Meta Module for Thruway
MIT License
4 stars 0 forks source link

Thruway module for RPC Meta API #1

Open vvasystem opened 6 years ago

vvasystem commented 6 years ago

Where is I can find Thruway module for this https://github.com/wamp-proto/wamp-proto/blob/master/rfc/text/advanced/ap_rpc_registration_meta_api.md?

adriaangraas commented 6 years ago

The module is afaik not (yet) available. Note, with a little bit of copy-paste and editing of the SubscriptionMetaModule you build your own RegistrationMetaModule with wamp.registration.on_create, wamp.registration.on_unregister and wamp.registration.on_delete at your disposal. This should be quite straightforward, but let me know if you can't work it out.

The real difficulty is with adding realm-independent procedures with a RouterModuleClient, i.e. WAMP proto section 14.3.7.1.3. Ideally, you would have a session that is shared among all the open realms, so that the procedures would be available in every realm. However, the internal client registers only in the the realm that the module is loaded onto.

Thus, if you want your registration meta-procedures to only work in one realm, you're lucky, and you just implement the onSessionStart of your module. If you really want to have it work in all realms, you can handle the the CallMessageEvent and catch wamp.registration.list etc. procedure calls there.

If somebody has a better solution (@mbonneau @davidwdan), please comment.

mbonneau commented 6 years ago

I also am unaware of a module as of right now.

The implementation that @adriaangraas suggests sounds good. In order to keep separate realm information I would suggest creating the realm module as a separate class and instantiating a new one each time a realm is created.