windowspython-3.xasync-awaitcurio

How do I make a Python async named pipe server using curio?


How do you create an asynchronous named pipe server with Dave Beazley's curio library? If not that one, is there any library faster and/or more intuitive to use than Python's default asyncio library that I could easily us to write an asynchronous named pipe server?


Solution

  • Well, the answer seems to be that, for now, you don't. You can do it with Python's built in asyncio though, but only if you use asyncio.windows_events.ProactorEventLoop as your event loop. And that event loop can't also handle stdin and stdout, so you're forced into using two threads if your program needs to stay responsive to user input.