are you using a non-blocking ZMQ client library?
https://github.com/smira/txZMQ
if not, this is an issue .. with a "normal" blocking client library, you
will effectively block the whole event reactor inside Twisted --
btw: same for DB libs. here, almost all are blocking. you will need to use
https://twistedmatrix.com/documents/current/core/howto/rdbms.html
which wraps those libs running the blocking DB connections on a
background worker thread pool
Am 09.10.2015 um 17:48 schrieb Samuel Coombs:
> So when using zmq with crossbar you have to pass the flag zmq.NOBLOCK in
> the socket receive. Also there needs to be a yield sleep(#) somewhere in
> the while loop or else it will not exit. I do not understand why there
> needs to be a sleep, so i just put a small sleep period.
>
> Now crossbar will end using crossbar stop.
>
> Thanks again for helping me out!
>
> On Friday, October 9, 2015 at 9:27:56 AM UTC-4, Samuel Coombs wrote:
>
> Tobias, thank you for your response.
>
> Running it as an admin does not stop that process. Yes it is
> connected to a database but that connection is not always open. I
> receive a json file using ZMQ. Once I receive a message, I send it
> to a function which open a database connection and write the data,
> then closes the connection.
>
> The problem is with ZMQ, it sits there and waits for a message. Only
> CTRL-C will kill that process, so I will have to fix that and will
> let you know if I fix it.
>
> If you would like to play around with this here is the code. I took
> out the database stuff because right now that is not the problem,
> It's ZMQ.
>
>
> from twisted.internet.deferimport inlineCallbacks
> from twisted.loggerimport Logger
> from autobahnimport wamp
> from autobahn.twisted.utilimport sleep
> from autobahn.twisted.wampimport ApplicationSession
> import zmq, json
>
>
> class AppSession(ApplicationSession):
> log = Logger()
>
> @inlineCallbacks
> def onJoin(self, details):
> # setting up zmq to read from port 5555
> ctx1 = zmq.Context()
> OverViewSocket = ctx1.socket(zmq.PULL)
> OverViewSocket.setsockopt(zmq.RCVHWM, 1)
> OverViewSocket.bind('tcp://*:5555')
>
self.log.info <
http://log.info>('Overview Ready')
> while True:
> msg = OverViewSocket.recv()
> yield self.publish("com.example.Overview", msg)# publish to 'com.example.Overview'
> yield
self.log.info <
http://log.info>(msg)
> is on the
crossbar.io <
http://crossbar.io>
> website and modified that, I just changed
> the port and classnames for the containers.
>
> On Thursday, October 8, 2015 at 9:51:36 AM
> UTC-4, Alexander Gödde wrote:
>
> Hi Samuel!
>
> This behavior is not something that
> we've encountered during our testing.
>
> Could you post more information about
> what precisely you are doing in the
> worker and how things are configured?
> With the current information we can't
> really give you any feedback.
>
> Regards,
>
> Alex
>
>
> Am Donnerstag, 8. Oktober 2015 15:10:50
> UTC+2 schrieb Samuel Coombs:
>
> Hello,
>
> I just started using
crossbar.io
> <
http://crossbar.io> (python) and I
> have a program that has 4 workers(3
> containers and 1 router).
>
> I have a problem when I stop
> crossbar. When I use CTRL-C to stop
> it, all the processes end and I am
> able to start it again. When I use
> the command 'crossbar stop' only 3
> of the 4 processes end. When I try
> to start crossbar again, 3 of the
> workers will start, and when the 4th
> one tries to start, it will fail and
> I will get the error 'Address in Use.'
>
> I was wondering if there is
> something I am doing wrong or is
> there a bug somewhere?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Crossbar" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
crossbario+...@googlegroups.com
> <mailto:
crossbario+...@googlegroups.com>.
> To post to this group, send email to
cross...@googlegroups.com
> <mailto:
cross...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/crossbario/1c14eace-10b1-4b59-b3d4-31b3b7e647a2%40googlegroups.com
> <
https://groups.google.com/d/msgid/crossbario/1c14eace-10b1-4b59-b3d4-31b3b7e647a2%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit
https://groups.google.com/d/optout.