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.

Gabe
  • 11
  • 2

1 Answers1

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

oberstet
  • 21,353
  • 10
  • 64
  • 97