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

Introduce "singleton" concept to prevent processing/adding concurrent jobs with same group id #14

Open
sneljo1 opened this issue May 1, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@sneljo1
Copy link

sneljo1 commented May 1, 2024

Similar to the concept in pg-boss, it makes sense for some use-cases to only allow 1 job within a specific group in an active state and only allow 1 extra to be queued. It would make this library a good fit for my use-case. Is this something that would be possible/makes sense to add here?

https://github.com/timgit/pg-boss/tree/master/docs#sendsingletonname-data-options

@kraih
Copy link
Member

kraih commented May 1, 2024

I think this feature has come up a few years ago for the Perl version. If i remember correctly we couldn't come up with enough use cases (we usually require at least two unique use cases for a feature to be considered).

@kraih kraih added the enhancement New feature or request label May 1, 2024
@kraih
Copy link
Member

kraih commented May 1, 2024

Also be aware that locks exist. which makes finding unique use cases without overlap a little harder. https://github.com/mojolicious/minion.js#locks

@sneljo1
Copy link
Author

sneljo1 commented May 1, 2024

Makes sense, thanks 👍

@sneljo1
Copy link
Author

sneljo1 commented May 2, 2024

They are definitely versatile, but the only thing with the locks then is that you can really only use it with tasks that have a known/fixed time limit (without overshooting the TTL) and cannot rely on the heartbeats to unlock them automatically. Or is it possible to mimic this heartbeat functionality by somehow extending the lock?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants