I'm looking into using the Cache::lock mechanism with laravel, but something isn't exactly clear to me.
This is the example they use:
$lock = Cache::lock('foo', 10);
if ($lock->get()) {
// Lock acquired for 10 seconds...
$lock->release();
}
Now, it's my understanding that under NORMAL conditions, if the lock is still in place when $lock->get() is called, it will wait for the previous lock to be released before continuing on. Is that correct? (that seems like the whole point of a lock to me, so I certainly hope that's correct).
If that is correct, then what would ever make $lock->get() return false? Would it return false if it expects the wait time to be over 10 seconds, or something like that?