asyncio: wrapping a subprocess in a server

David Farler accumulator at icloud.com
Wed Jun 25 14:24:55 EDT 2014


Hi all,

I'm trying to vend some kind of server that spawns a client-unique subprocess when a client connects. The server acts as a middleman, receiving structure messages from the client, sending input to the subprocess, and packaging up subprocess data before sending back to the client. The connection is long-lived and the client can continue to send "requests". If the subprocess crashes or dies, the server should be able to revive it transparently.

I know how to separately create server and subprocess protocols and having the event loop run either until completion, but what is the best way to chain two protocols together?

|| Client || <~~ TCP ~~> || Server <--> Subprocess ||

Regards,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140625/5b14d104/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4148 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20140625/5b14d104/attachment.bin>


More information about the Python-list mailing list