Calling publish from outside a custom Autobahn WampClientProtocol
Asked Answered
I

1

1

How do I call an autobahn/wamp/twisted protocol publish method from outside of the protocol class?

I have a custom python autobahn client based on https://github.com/tavendo/AutobahnPython/blob/master/examples/wamp/pubsub/custom/client.py. I am attempting to publish an event from outside of the custom WampClientProtocol class and am having trouble. If I assign the protcol object to a variable, line 1387 of wamp.py (https://github.com/tavendo/AutobahnPython/blob/master/autobahn/autobahn/wamp.py) fails with exception "MyClientProtocol instance has no attribute factory". If I try and call the factory (i.e. "factory.protocol.publish(msg)"), I get the error that the publish method is unbound.

Ineptitude answered 1/3, 2013 at 17:33 Comment(0)
R
3

Just in case someone stumbles upon this question: solutions were discussed on the Autobahn mailing list and working code can be found here: https://github.com/oberstet/scratchbox/tree/master/python/gephi

Rebatement answered 1/3, 2013 at 23:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.