vendredi 24 février 2017

Global thread-safe in memory variable?

This is a bit of a long shot, but hoping someone may know. Is there a way to define a variable in memory (preferably accessible by Laravel and it's workers, globally), that can be used to ensure that Workers don't overlap.

It should be noted that we've got an odd multi-tenancy setup, which means we can't use the standard queues and thus have no access to ->withoutOverlap. Our workers are scheduled to run every hour, but depending on data sources, completion may not be for days+.

I have created good old fashioned .lock files, but if for whatever reason, we need to reboot something, due to the length of time these workers can take, it isn't ever safe to assume that any .lock file has been orphaned. This would be an ideal scenario for semaphores, but in my testing, these always blocked, which lead to an unwanted queue of jobs, verging on loadtesting.

Any help is very much appreciated.



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

Aucun commentaire:

Enregistrer un commentaire