Answer the question
In order to leave comments, you need to log in
Laravel 5.1. How to start and stop a specific job in a queue?
Hello.
There is a certain job which should be infinitely executed with a delay let's say in 30 sec.
class SomeJob extends Job implements SelfHandling
{
use InteractsWithQueue;
public function __construct()
{
//
}
public function handle()
{
//что-то делаем
$this->release(30);
}
}
$job = (new SomeJob())->onQueue('someQueue');
$this->dispatch($job);
$this->delete();
Answer the question
In order to leave comments, you need to log in
You need to use the Queue facade to retrieve jobs. You need to get the queue itself first, extract it from it by job id.
See here:
stackoverflow.com/questions/25107359/deleting-runn...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question