-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use Jesqueue's build in delayed job feature #11
Comments
This would also provide access to Client#removeDelayedEnqueue() for when we need to cancel a scheduled job. In the current grails implemenation, I don't see a way to destroy or remove a scheduled job.
|
I just got around to testing it, and there was no problem using the underlying jesque client for delayedEnqueue and removeDelayedEnqueue. My test job executed at the correct time. Using: Here's examples using the jesque client syntax:
So, it appears that it would be straight forward to use the jesque client in the next release. |
Actually, it would also require the grails plugin to integrate the 2.1.1 jesque project implementation of WorkerImpl.pop(), which uses a lua script to ensure that only a single worker runs a delayed and/or scheduled task. Otherwise, user is exposed to a pre jesque 2.1.1 bug where multiple workers execute a single delayed or recurring task. (This can be a disaster if the task is not explicitly, defensively coded to protect against this case. I've had to implement custom locking logic to ensure this in my app.) In the meantime, the current grails plugin doesn't support removing delayed tasks, which can be a deal breaker for many apps, and is natively supported in jesque. |
fyi, I confirmed that v1.2.1 grails plugin version of recurring jobs does not suffer from the multiple workers concurrently executing the recurring job jesque bug, even in a distributed environment. (Very good!) |
I just worked on this a bit. See #27 Actually the jesque delayed job feature works a bit differently: I managed to keep the plugins old behaviour by transparently handling of the jesque delayed queues. Input welcome! |
Since quite some time now the jesque library supports delayed enqueuing of Jobs.
the grails plugin still uses it's own delay implementation which is not super different from the "original" one.
I guess switching to the original one is not to awfully hard no?
The text was updated successfully, but these errors were encountered: