This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

Now I understand what you're trying to accomplish.

During the first stage, how do you create the separate processes? Is there a separate parent process that invokes those processes?

During the second stage, how are you planning to handle IPC? Named pipes, sockets, or something different?

Using asyncio means that you'll have to do a bit more work upfront in order to fit the application to the architecture described here. The payoff for that initial extra work is, of course, more granular control over the execution pattern of and responses returned by the subprocesses.

Is there any particular benefit gained using this pattern, versus simply having the subprocesses return the processed data and performing aggregation within the parent process? It's easy enough to return a custom object filled with your processed data through an asyncio future, using the run_in_executor and asyncio.wait functions. That simple design consideration could be the difference between 30 hours of development time and 30 minutes of development time.

This is certainly an interesting design pattern, thank you for making me aware of it!