jeudi 2 août 2018

Why are Laravel 5.6 job event listeners executing synchronously?

The event PurchaseMade is executed asynchronously. I have no problem with that. But why would its event listeners listening for this execute synchronously?

I thought using Redis Queues would execute both SyncPurchaseMadeToSalesforce and WhenPurchaseIsMadeIncrementUsersAccessUntilDate as parallel jobs, but after having inspected the timestamps in my database, they are blocking.

The second event listener waits for the first one to complete. I do not want that. How can I fix? I want the second event to be executed ASAP without any blocking, as it impacts user experience on frontend.

'Fitterclub\Events\PurchaseMade' => [
            'Fitterclub\Listeners\SyncPurchaseMadeToSalesforce',
            'Fitterclub\Listeners\WhenPurchaseIsMadeIncrementUsersAccessUntilDate',
        ],



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire