-
Notifications
You must be signed in to change notification settings - Fork 3
support sync generator #5
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
Conversation
|
Thank you for your contribution, it's a very clever implementation. |
Glad to contribute. I have been searching for useful concurrent frameworks for quite some time, and this is the lightest and most practical one I have seen. |
|
I am trying to support generators at the base class level of Job, making the implementation of process a special case. |
|
OK, expecting official implementation. I tried |
|
I have defined the run_generator method in the base class of Job and made the implementation of ProcessJob a specific case of it. executor-engine/executor/engine/job/base.py Lines 289 to 306 in 389af29
I think you can build upon this and incorporate your implementation of Additionally, some management of the lifecycle has been added. Currently, the status of the corresponding job will only be set to executor-engine/tests/test_job.py Lines 191 to 216 in 389af29
More details see 389af29 |
|
Ok, I would like to try it. |
As discussed in #3 , I rewrite ProcessJob.run to support sync generators.
Please review if this approach is appropriate, we can rewrite other Job.run methods and support async generators too.
example code: