ethereum / asyncio-run-in-process

A simple asyncio friendly replacement for multiprocessing to run coroutines in a separate process.
MIT License
13 stars 9 forks source link

Initial library code #1

Closed pipermerriam closed 5 years ago

pipermerriam commented 5 years ago

What is this?

This implements the core of the library which are two functions.

These functions allow running arbitrary coroutines in isolated processes and getting their results.

These are implemented such that SIGTERM and SIGINT are automatically propagated to child processes and chat child processes.

A SIGKILL to a child process also behaves correctly with the child process reporting a ProcessKilled exception as the error.

Exceptions in child processes are also properly propagated to the parent process.

Cute Animal Picture

o-CUTE-ANIMALS-PHOTOS-facebook

pipermerriam commented 5 years ago

You don't all have to review this but I pinged all of you because this is my proposed code for replacing multiprocessing in Trinity and I'd like to get any feedback you might have on the API or whatever before going ahead towards a 0.1.0 release.

carver commented 5 years ago

Cool, I just skimmed it, but nothing stood out as a big problem. I did think it was a little strange that setting the return code and error is on the public API, since I'd expect that to be handled internally.

Unrelated: I'd recommend splitting out the template filling into a separate commit. (Maybe a different PR, next time).

pipermerriam commented 5 years ago

FYI, merged and published as 0.1.0-alpha.1 so that we can start tinkering with it.