Laravel queue, redirect after dispatch | بلاگ

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

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