Skip to content

Understanding job execution order #816

Answered by JohnRoesler
FalcoSuessgott asked this question in Q&A
Discussion options

You must be logged in to vote

I would like to understand the exact order in which the jobs are being executed. Is it FIFO or is non deterministic?

The jobs are stored in a map. So, depending on how you add them to the scheduler, the answer is different.

  1. If you add all your jobs to the map, and then start the scheduler, the range/iteration order for scheduling will be: https://go.dev/blog/maps#iteration-order

    the iteration order is not specified and is not guaranteed to be the same from one iteration to the next.

  2. If you start the scheduler, and then add each job, they would be scheduled immediately, and so in the order that you add each job to the scheduler via NewJob

How is the execution order affected in sing…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by FalcoSuessgott
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