[zeromq-dev] Using zeromq inside twisted matrix daemon

Uung H.R Bhuwono avenpace at gmail.com
Wed Jul 28 09:25:14 CEST 2010


Hi,

I've been trying to make use zeromq on my twisted daemon script
When zeromq send message to the queue, this work since send_pyobj()
return True.
But the subscriber never get the message from queue using recv_pyobj()
and it just freeze like there's nothing on the queue

My twisted daemon script as a follow:

- serve_message.py
class MyService(service.Service):
   def __init__(self):
       pass
   def startService(self):
       c = zmq.Context(1)
       s = c.socket(zmq.PUB)
       s.bind("tcp://127.0.0.1:6666")
       s.send_pyobj("helo there")
   def stopService(self):
       pass

def getMyService():
   myService = MyService()
   return myService

application = service.Application("My Service Application")

# attach the service to its parent application
procd = getMyService()
procd.setServiceParent(application)

my simple subscriber script subscriber.py

import zmq
c = zmq.Context(1)
s = c.socket(zmq.SUB)
s.connect("tcp://127.0.0.1:6666")
s.setsockopt(zmq.SUBSCRIBE, "")
s.recv_pyobj()

I assume that twisted daemon messed up the zeromq messages queue
Does it possible to use zeromq with twisted daemon on Linux?
Does anyone has succeed before using zeromq with twisted daemon?


Thanks,

Uung



More information about the zeromq-dev mailing list