New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to inherit AioProcess #37
Comments
Use |
Tue, 07 Sep 2021 10:22:16 -0700 dano ***@***.***>:
Use `from aioprocessing.process import AioProcess` instead. `aioprocessing` mirrors the `multiprocessing` library here - the objects exposed from the top-level module namespace are functions, not classes. The actual class is in a sub-module.
I got your intentions, but you see, class inheritance from multiprocessing works in this way too (tested on latest version and even on cpython alpha)
|
@TanyaEleventhGoddess Ah, looks like the implementation of I'll leave this open for now, I'm not sure it's worth the effort to refactor the library to match what multiprocessing is doing now, but I should at least document the unusual "function instead of class" behavior. |
Wed, 08 Sep 2021 07:43:26 -0700 dano ***@***.***>:
@TanyaEleventhGoddess Ah, looks like the implementation of `multiprocessing` has changed since I created `aioprocessing`, and no longer uses functions for the top-level imports. In any case, `aioprocessing` still does use functions, so just use `from aioprocessing.process import AioProcess` for now.
I'll leave this open for now, I'm not sure it's worth the effort to refactor the library to match what multiprocessing is doing now, but I should at least document the unusual "function instead of class" behavior.
I may be willing to do that, along with proper inheritance support and ability of overriding internal functions, and async coroutines support in child processes, but I'd prefer some help in doing that. What's your opinion?
|
Executing the following code
results in the following error:
I uh... expect to easily be able to override how a class works & his internal functions
The text was updated successfully, but these errors were encountered: