Non-blocking multiprocessing.connection.Listener? : <p>I use multiprocessing.connection.Listener for communication between processes, and it works as a charm for me. Now i would really love my mainloop to do something else between commands from client. Unfortunately listener.accept() blocks execution until connection from client process is established.</p>

<p>Is there a simple way of managing non blocking check for multiprocessing.connection? Timeout? Or shall i use a dedicated thread?</p>

<pre><code>    # Simplified code:

    from multiprocessing.connection import Listener

    def mainloop():
        listener = Listener(address=(localhost, 6000), authkey=b'secret')

        while True:
            conn = listener.accept() # &lt;---  This blocks!
            msg = conn.recv() 
            print ('got message: %r' % msg)
            conn.close()
</code></pre>
