lundi 13 novembre 2017

How to dispatch jobs to different queue providers in Laravel

In my api I am using Redis for caching dispatched jobs from my controllers: This is how my controller looks

class FormSubmissionsController extends Controller
{
    /**
     * @param StoreRequest $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function store(StoreRequest $request, FormSubmission $formSubmission)
    {

        JobStore::dispatch($formSubmission, $request->get('tracking_code'), $request->get('form'));

        return response()->json([
            'id' => $formSubmission->id
        ]);
    }
}

All is working, and the only change I did to use redis it was some config vars in dot env file. My question:

In another controller I want to use some of Amazon SQSservices for queued jobs, any idea how to config queue and how should I dispatch each job to particular queue handler ?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ABMdXb
via IFTTT

Aucun commentaire:

Enregistrer un commentaire