wa0x6e / Cake-Resque

Resque plugin for CakePHP : for creating background jobs that can be processed offline later
MIT License
159 stars 56 forks source link

How to dequeue a job?! #48

Closed amiri27 closed 10 years ago

amiri27 commented 10 years ago

Hi..

Is there any method to dequeue a certain job id from scheduler queue ? If there's no method to satisfy this need I'm ready to add this method and create a pull request for that..

Regards, Mostafa Amiri

wa0x6e commented 10 years ago

You're welcome to try.

amiri27 commented 10 years ago

Is there any implementation of this method on php-resque ? Do you have any reference that can help me on implementing on this method?

Regards,

wa0x6e commented 10 years ago

You can start by looking at the original ruby version : https://github.com/resque/resque-scheduler/blob/master/lib/resque_scheduler.rb#L307

But the current implementation does not make that easier at all, since you can't search in Redis. You have to get all jobs one by one, and search for the wanted ID.

It's so impractical that it's not worth it.