Top-rated recipes tagged "ipc"http://code.activestate.com/recipes/tags/ipc/top/2013-03-13T06:06:16-07:00ActiveState Code RecipesAsynchronous subprocess using asyncore (Python)
2013-01-21T19:51:00-08:00Glenn Eychanerhttp://code.activestate.com/recipes/users/4172294/http://code.activestate.com/recipes/576957-asynchronous-subprocess-using-asyncore/
<p style="color: grey">
Python
recipe 576957
by <a href="/recipes/users/4172294/">Glenn Eychaner</a>
(<a href="/recipes/tags/async/">async</a>, <a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/asyncore/">asyncore</a>, <a href="/recipes/tags/coroutine/">coroutine</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/subprocess/">subprocess</a>).
Revision 21.
</p>
<p>A coroutine-based wrapper for subprocess.Popen that uses asyncore to communicate with child processes asynchronously. This allows subprocesses to be called from within socket servers or clients without needing a complicated event loop to check both. Uses <a href="http://code.activestate.com/recipes/576965/">recipe 576965</a> to provide the asynchronous coroutine framework, <a href="http://code.activestate.com/recipes/576967/">recipe 576967</a> to provide asynchronous pipes, and <a href="http://code.activestate.com/recipes/577600/">recipe 577600</a> to provide multiple alarms.</p>
Subprocess with async I/O pipes class (Python)
2009-05-17T02:02:04-07:00Mike Kazantsevhttp://code.activestate.com/recipes/users/4170279/http://code.activestate.com/recipes/576759-subprocess-with-async-io-pipes-class/
<p style="color: grey">
Python
recipe 576759
by <a href="/recipes/users/4170279/">Mike Kazantsev</a>
(<a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/non_blocking_i_o/">non_blocking_i_o</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/subprocess/">subprocess</a>).
Revision 2.
</p>
<p>Just stumbled upon the need to move data chunks between subprocesses in a non-linear way with some logic in-between, so tee(1) and fifo(7)'s weren't too good option.
Inspired by 440554, but rewritten from scratch to remove unnecessary delays due to sleep(3) calls and suboptimal try/sleep-based polling.</p>
Threaded communication with subprocess (Python)
2013-03-13T06:06:16-07:00Jan Müllerhttp://code.activestate.com/recipes/users/4183984/http://code.activestate.com/recipes/578488-threaded-communication-with-subprocess/
<p style="color: grey">
Python
recipe 578488
by <a href="/recipes/users/4183984/">Jan Müller</a>
(<a href="/recipes/tags/async/">async</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/messaging/">messaging</a>, <a href="/recipes/tags/multithreading/">multithreading</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/queue/">queue</a>, <a href="/recipes/tags/subprocess/">subprocess</a>).
Revision 3.
</p>
<p>This recipe shows how to domesticate another executable as a service in a subprocess.</p>
commanding via a duplex pipe stream. (C)
2009-06-07T01:41:19-07:00J Yhttp://code.activestate.com/recipes/users/4170398/http://code.activestate.com/recipes/576773-commanding-via-a-duplex-pipe-stream/
<p style="color: grey">
C
recipe 576773
by <a href="/recipes/users/4170398/">J Y</a>
(<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/pipe/">pipe</a>).
Revision 2.
</p>
<p>commanding via a duplex pipe stream.</p>