You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before I get started, I am not sure if this is a bug, because it is unclear if what I am trying to do is even expected, we might end up closing this saying "batches were never meant to support that" and that is fine.
I was attempting to do some job batching, in which there are two separate queues that the jobs within the batch are placed within.
For the sake of example, the two queues were "processing" and "outbound" so I can handle prioritizing this properly. I started out using sqlite for my queue and db driver, however quickly switched to mariadb.
During this process, I realized that no matter what I do when I create a batch via a hydration job, I cannot seem to get onQueue() to place the specific job into the batch but on the specified queue. Below is some example code.
at a couple points I referred to the Laravel documentation that state, "Alternatively, you may specify the job's queue by calling the onQueue method within the job's constructor:
In my specific case Job1 would hydrate the batch, with more Job1's and Job2's (which in this specific case were supposed to be on the outbound queue).
I noticed that until I stopped batching the items, I was unable to set the queue properly on items within the batch.
Steps To Reproduce
Create a batch, use a recursive job (Job 1) to hydrate the batch with more instances of itself on one queue, meanwhile in Job 1 it will also continue to hydrate the batch with another job (Job 2) but on another queue.
The text was updated successfully, but these errors were encountered:
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Laravel Version
^11.9
PHP Version
8.3.13
Database Driver & Version
MariaDB
Description
Before I get started, I am not sure if this is a bug, because it is unclear if what I am trying to do is even expected, we might end up closing this saying "batches were never meant to support that" and that is fine.
I was attempting to do some job batching, in which there are two separate queues that the jobs within the batch are placed within.
For the sake of example, the two queues were "processing" and "outbound" so I can handle prioritizing this properly. I started out using sqlite for my queue and db driver, however quickly switched to mariadb.
During this process, I realized that no matter what I do when I create a batch via a hydration job, I cannot seem to get onQueue() to place the specific job into the batch but on the specified queue. Below is some example code.
at a couple points I referred to the Laravel documentation that state, "Alternatively, you may specify the job's queue by calling the onQueue method within the job's constructor:
In my specific case Job1 would hydrate the batch, with more Job1's and Job2's (which in this specific case were supposed to be on the outbound queue).
I noticed that until I stopped batching the items, I was unable to set the queue properly on items within the batch.
Steps To Reproduce
Create a batch, use a recursive job (Job 1) to hydrate the batch with more instances of itself on one queue, meanwhile in Job 1 it will also continue to hydrate the batch with another job (Job 2) but on another queue.
The text was updated successfully, but these errors were encountered: