문제

My object:

class mysrv(object):
    def __init__(self):
        self._pubsocket = context.socket(zmq.PUB)
        self._socket = context.socket(zmq.REP)
        self._socket.bind("tcp://127.0.0.1:9003")
        self._pubsocket.bind("tcp://127.0.0.1:9004")

Then I run both functions:

def main():
    s = mysrv()
    Process(target=s.publoop()).start()
    Process(target=s.reqrep()).start()

The first function blocks the second. Is there any way to run them from a single class instance?

도움이 되었습니까?

해결책

The answer is that while will block everything even sleep is called.

So, running many whiles in the same process without breaks is blocking.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top