yeah, or just 'async for line in line_parser(receive_stream): ...', assuming 'line_parser' is a piece of code you already have
(still building up that infrastructure, but that's the point of having a standard stream interface, so you can write things like line_parser and re-use them in different contexts)
meejah
makes sense (kind-of-maybe something like "tubes", even if I haven't really used that either ;)
njs
in terms of basic program structure, trio programs are basically like normal python except you can spin up multiple tasks and cancel things -- it tries to be a bit more familiar to synchronous programmers than twisted does (for better and worse :-))
meejah
...but a "task" is still single-threaded/event-based like it would be in twisted or asyncio, right?
dang, i wish i had infinite time to check out new projects ;)
("new" :)
njs
meejah: yeah, from the user perspective a "task" acts basically like a thread: it's a single synchronous line of execution, you can call functions, block (using 'await' syntax), etc. But then under the hood, the trio scheduler multiplexes all the tasks onto a single operating-system thread.
it's interesting that twisted's spawnProcess defaults to not passing through the environment