I am trying to execute a code after some delay using laravel 7 job queue. The constructor method is working but not the handle method. My code is given below:
Controller:
public function test()
{
echo 'starting ....';
$reset = (new ResetLockers())->delay(now()->addSeconds(10));
dispatch($reset);
}
Job:
class ResetLockers implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct()
{
echo 'constructing ...';
}
public function handle()
{
echo 'job dispatched';
}
}
database:
output:
any clue?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire