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

Adding a subQueue or workIdentifier field #129

Open
bjartek opened this issue Nov 14, 2022 · 2 comments
Open

Adding a subQueue or workIdentifier field #129

bjartek opened this issue Nov 14, 2022 · 2 comments

Comments

@bjartek
Copy link

bjartek commented Nov 14, 2022

Would it be possible to add a new string field to the job table that specifies text field that identifies that this particular job is of a particular run/batch of said job? The use case here is around me checking for dependent items in queue.

  • I cannot use Type as that is used to map to a function
  • I cannot use Queue as that is used to run seperate workerPools
  • I could use Args and run a Json query but not sure how efficient that is

if we had a field job_batch_id (tentative name) that could optionally be added to a job checking this would be very easy. I could basically as part of the wrapper I have to check if a job should run check if there are any active jobs with a given subQueue and if it is reschedule the job to run later.

Also then I could say that if a job Enques other jobs it can use the same subQueue as parent or atleast use that as a prefix.

I know this is pushing the boundaries of the project a little but it is just a single field added from the perspective of this project.

Btw do you have a patreon set up here? You are doing amazing work and should be rewarded.

@vgarvardt
Copy link
Owner

I would not add it as part of the library - this can be easily implemented using additional table, where you can store job id, that is available after calling Enqueue on the client, and any other information you need to associate with this job. Hooks can be used to cleanup this table after the job is done.

@vgarvardt
Copy link
Owner

Btw do you have a patreon set up here? You are doing amazing work and should be rewarded.

I was thinking about enabling this, but need to check how taxes are working here in Germany for OSS sponsorship/donations first.

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

No branches or pull requests

2 participants