Skip to content

Running a sequential task 3 parallel #229

Answered by Jypear
kuatroka asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure if it helps in your situation (Not tested in multiprocessing or async) but there is a after_all_finish from rocketry.conds you can use. It accepts *args from the tasks you want to run the task after.

The way it works is it will only execute a task after all the tasks passed into the function have run atleast once.

import logging
from rocketry import Rocketry
from rocketry.conds import after_all_finish

app = Rocketry()

logging.basicConfig(
     level=logging.INFO, 
     format= '[%(asctime)s] %(levelname)s - %(message)s',
     datefmt='%H:%M:%S'
 )

logger = logging.getLogger(__name__)

@app.task("every 4 seconds")
def taskone():
    logger.info("running task 1")

@app.task("eve…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kuatroka
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants