I have a queue. After completing all the tasks, I would like to execute the function. Example
Queue: Task1 Task2 Task3 Task4 Task5
Here, when queue is empty, we have to run Function. The documentation only has an event that fires after every task.
I have a queue. After completing all the tasks, I would like to execute the function. Example
Queue: Task1 Task2 Task3 Task4 Task5
Here, when queue is empty, we have to run Function. The documentation only has an event that fires after every task.
Hey Alex you could work with Livewire and request all 3 sec if the table jobs is empty. when the table is empty you can then fire a function.
Livewire Controller:
public string $filename;
public mixed $errorlist = [];
public bool $showLoadSequence = True;
public function getError()
{
// check if job table is empy
if (!DB::table('jobs')->exists() && $this->showLoadSequence === True) {
$this->showLoadSequence = False;
// call to action!
}
$errors = ValidationResult::where('file_name', '=', $this->filename)
->where('isValid', false)
->get();
if (count($errors) !== count($this->errorlist)) {
$this->errorlist = $errors;
}
}
public function render()
{
return view('livewire.error-loader');
}
Live wire blade:
<div wire:poll.3s="getError">
//html tags
</div>