Techiio-author
Started by Jake WiliamsSep 25, 2021

Open
What is ShouldBeUnique in laravel Queues

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

I am currently tackling against race conditions in api data fetching and would like to understand why ShouldBeUnique doesn't work the way I expect it to.

What I think is that when we dispatch job implementing this interface, it doesn't become available to workers right away. Instead, queue will have only one job, while others will wait until it will become processed. Then another from waiting pull becomes available and so on.

However when I test it with multiple workers, I get race condition. How does this even work?

0 Replies

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance