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

feat(flow): support passing a chain option #2949

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Conversation

roggervalf
Copy link
Collaborator

@roggervalf roggervalf commented Dec 4, 2024

Imagine that you have 2 jobs (A and B), where B depends on the completion of A. This kind of dependency relationship should be handled by our waiting-children state.
What would happen if these 2 jobs happened in different transactions? In order have a way to link these 2 separated operations we need to track the reference of this chain of dependencies.
I'm introducing a new concept of saving a chain id reference where job A and B must provide it as option. Chain id and chain queueKey are used to build a chainKey to track the last jobKey reference to be used for the next subsequent jobs with same chain options to be added in the same dependency relationship.
Points to consider:

  • ChainKey only saves the last job reference in the chain
  • If last job in the chain finishes before a new job is added with same option, chain reference is deleted. New job will start a new chain.

@roggervalf roggervalf changed the title feat(flow): support passing a chain id feat(flow): support passing a chain option Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant