[8.x] Add extend option to Atomic Locks #32524
[8.x] Add extend option to Atomic Locks #32524georgeboot wants to merge 3 commits intolaravel:masterfrom
Conversation
| */ | ||
| public function extend($seconds) | ||
| { | ||
| return (bool)$this->redis->expire($this->name); |
There was a problem hiding this comment.
How does this extend anything? The seconds are literally never used.
| public function release() | ||
| { | ||
| return (bool) $this->redis->eval(LuaScripts::releaseLock(), 1, $this->name, $this->owner); | ||
| return (bool)$this->redis->eval(LuaScripts::releaseLock(), 1, $this->name, $this->owner); |
|
I am closing this pull request because it lacks sufficient explanation, tests, or both. It is difficult for us to merge pull requests without these things because the change may introduce breaking changes to the framework. Feel free to re-submit your change with a thorough explanation of the feature and tests - integration tests are preferred over unit tests. Please include it's benefit to end users; the reasons it does not break any existing features; how it makes building web applications easier, etc. Thanks! |
|
Thanks for the feedback. Will re-submit when it’s more complete. @taylorotwell What is the best way for me to get someone collaborating on the DynamoDB part? |
This PR adds support for extending existing atomic locks.
Adapters to implement:
Use case
Imagine a support system, where only one agent at a time, can work on a case.
When implementing this with atomic locks, you would want to lock a case for 30 seconds, and have the page poll every 15 seconds. That poll request should be able to extend the existing lock.
When the agent leaves the page, the case will automatically be unlocked as soon as the lock expires.
Help wanted
I'm not experiences with DynamoDB, so I can't figure out how to easily extend the TTL of a record. Perhaps someone else wishes to share their wisdom?