I've been working on launching child processes asynchronously (and reading their output) for some transcoding jobs I want to do in the background. (The code can be found here if you're curious: process-nio)
It works well in my little testclient, but as soon as I try to integrate with a simple backend based on Vapor I hit the following precondition:
NIOPosix/Bootstrap.swift:1026: Precondition failed: limitation in SwiftNIO: cannot bootstrap PipeChannel on EventLoop.
What are good ways to work around this, or put differently: how would I design the way I'm trying to use NIO for async IO better around my use case? Could I 'abuse' some of the pre-existing infrastructure bootstrapped for the webserver to achieve my goals?
I strictly tried to not use
NonBlockingFileIO since it uses a thread pool and I specifically wanted async reading since I'm using a Pipe. I could perhaps create the bootstrap before I'm in any event loops, however I'm not really sure if I could re-use that easily every time I want to launch a child process.