Sending a Dispatch on Subscription

#1

How would you send a dispatch on subscription? When some clients connect, I want to send them the current state. It's easiest for me to do that by streaming it to them across the pubsub, but it means being able to send them (and only them) a dispatch from within the custom topic service and subscription handler. Any suggestions?

0 Likes

#2

I think I may have solved this myself by passing the protocol to the topic service and assigning it to self.protocol in the topic service __init__. After that I'm calling self.protocol.dispatch with eligible=self.protocol.session_id. Does that sound right?

0 Likes

#3

A dispatch from a custom subscription handler could be the way to go:

https://github.com/tavendo/AutobahnPython/tree/master/examples/wamp/pubsub/custom

···

Am 09.03.2013 15:36, schrieb Gabriel Bassett:

How would you send a dispatch on subscription? When some clients connect, I want to send them the current state. It's easiest for me to do that by streaming it to them across the pubsub, but it means being able to send them (and only them) a dispatch from within the custom topic service and subscription handler. Any suggestions?

0 Likes

#4

I can’t seem to find this example. Has the URL changed?

···

On Monday, March 11, 2013 at 3:47:48 AM UTC-7, Tobias Oberstein wrote:

Am 09.03.2013 15:36, schrieb Gabriel Bassett:

How would you send a dispatch on subscription? When some clients connect, I want to send them the current state. It’s easiest for me to do that by streaming it to them across the pubsub, but it means being able to send them (and only them) a dispatch from within the custom topic service and subscription handler. Any suggestions?

A dispatch from a custom subscription handler could be the way to go:

https://github.com/tavendo/AutobahnPython/tree/master/examples/wamp/pubsub/custom

0 Likes