-
Notifications
You must be signed in to change notification settings - Fork 56
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
Batch enqueue #123
Comments
Hi, I'll split the requirements into two items. I think this ticket is only for the first one.
I'll focus on the first item here. The simplest API I can think off is a my $arrayRefOfJobIds = $minion->batch_enqueue(
[ ... enqueue parameters ... ],
[ ... enqueue parameters ... ],
[ ... enqueue parameters ... ],
...
); An alternative is similar to karjala@matrix suggestion. We would take a codeRef and all calls to $minion->tx(sub ($minion_tx, $db_tx) {
# do other work on DB
$db_tx->insert(...);
# and queue multiple jobs
$minion_tx->enqueue(....);
$minion_tx->enqueue(....);
$minion_tx->enqueue(....);
...
}); The advantage of this is that you can use the I think either of these is an options and both seem to be compatible with the three languages you mention. Best regards. Bye, |
I'm covered by @melo's comments. For me it's very important that I am able to execute arbitrary SQL statements to my database, in the same transaction that enqueues minion jobs. My use case is that I have to deduct credits from a user's account for adding a minion job, so these 2 things have to happen on the same transaction. Thanks. |
This came up in the Matrix channel. Apparently a few of our users would like to see support for batch enqueueing multiple jobs at once. Like in a database transaction. In this issue you can collect use cases to work out the exact requirements and maybe even the correct API.
But be aware that this has to work for all the databases and programming languages Minion supports.
The text was updated successfully, but these errors were encountered: