Laravel queue, redirect after dispatch

ساخت وبلاگ

Vote count: 0

I have job class in my package. Function is simple but time consuming. I'd like send it to run in background.

php artisan queue:work

works.

count = $count; $this->competition = $competition; } public function handle() {
//code body }
}

and in controller

dispatch((new StartLottery($count, $id))->onQueue('high'));

My goal is run this job immediately in background and unlock browser to do another instructions like redirect.

Unfortunately next things are doing after finish job. Finally user wait long time on response from server after his request.

Thanks in advance for any hints how can I move this job to background.

environment:

  • Laravel 5.4
  • php 5.6
  • debian 8
asked 1 min ago
jaroApp

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 347 تاريخ : دوشنبه 27 شهريور 1396 ساعت: 1:53