Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73588 > unrolled thread

Re: asyncio: wrapping a subprocess in a server

Started byAkira Li <4kir4.1i@gmail.com>
First post2014-06-26 00:40 +0400
Last post2014-06-26 00:40 +0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: asyncio: wrapping a subprocess in a server Akira Li <4kir4.1i@gmail.com> - 2014-06-26 00:40 +0400

#73588 — Re: asyncio: wrapping a subprocess in a server

FromAkira Li <4kir4.1i@gmail.com>
Date2014-06-26 00:40 +0400
SubjectRe: asyncio: wrapping a subprocess in a server
Message-ID<mailman.11242.1403728819.18130.python-list@python.org>
David Farler <accumulator@icloud.com> writes:

> 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 ||

Here's an example that uses Twisted http://stackoverflow.com/a/11729467

  javascript client <--> websocket <--> twisted server <--> subprocess

Do you want the same but using asyncio module?


--
Akira


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web