Skip to content
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

ENH: Add async tasks #60

Merged
merged 17 commits into from
Jul 23, 2022
Merged

ENH: Add async tasks #60

merged 17 commits into from
Jul 23, 2022

Conversation

Miksus
Copy link
Owner

@Miksus Miksus commented Jul 20, 2022

This PR adds async support (#28) for the main scheduler but also adds support for parallelizing tasks as async.

For example:

@app.task(execution="async")
async def 

Some notes:

  • If async def ... is used with execution as main, the scheduler won't continue until the task is completed
  • If the task itself is not using async def ... but just def ..., the task cannot be parallelized
  • The task should release the executor every once in a while so that the scheduler can also do work

@Miksus Miksus added enhancement New feature or request core Relates to the core functionalities (ie. base classes) built-in Relates to the built-in tasks, conditions etc. labels Jul 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2022

Codecov Report

Merging #60 (617de60) into master (49bbf4e) will increase coverage by 0.15%.
The diff coverage is 95.50%.

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   90.41%   90.56%   +0.15%     
==========================================
  Files          86       86              
  Lines        3892     3934      +42     
==========================================
+ Hits         3519     3563      +44     
+ Misses        373      371       -2     
Impacted Files Coverage Δ
rocketry/core/schedule.py 89.96% <91.48%> (+0.14%) ⬆️
rocketry/application.py 82.08% <100.00%> (+1.13%) ⬆️
rocketry/core/task.py 92.10% <100.00%> (+0.48%) ⬆️
rocketry/session.py 91.20% <100.00%> (+0.91%) ⬆️
rocketry/tasks/func.py 93.83% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49bbf4e...617de60. Read the comment docs.

@gaby
Copy link

gaby commented Jul 21, 2022

Looking forward to this feature!

@Miksus
Copy link
Owner Author

Miksus commented Jul 23, 2022

This PR also fixes numeric timeout,

@Miksus Miksus merged commit 91790ee into master Jul 23, 2022
@Miksus Miksus deleted the dev/async branch July 23, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
built-in Relates to the built-in tasks, conditions etc. core Relates to the core functionalities (ie. base classes) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants