Skip to content

Remove EtcdLock and apply breaking changes to lock interface#12

Merged
JulianVennen merged 17 commits intoaternosorg:masterfrom
JulianVennen:lock-interface
Apr 4, 2025
Merged

Remove EtcdLock and apply breaking changes to lock interface#12
JulianVennen merged 17 commits intoaternosorg:masterfrom
JulianVennen:lock-interface

Conversation

@JulianVennen
Copy link
Member

@JulianVennen JulianVennen commented Apr 3, 2025

Changes

  • Lock now implements LockInterface
  • setBreakOnDestruct, setIdentifier and update now return the lock instance ($this)
  • break() no longer performs unnecessary requests if the lock is not present
  • Added getRemainingLockDuration which returns the remaining duration a lock is valid for.

Breaking Changes

  • Removed EtcdLock. Use Lock and Lock->lock() instead.
  • The Constructor of LockInterface no longer acquires the lock. Use ->lock() instead
  • The parameters for lock, refresh and waitForOtherLocks are now properties of the lock itself.
  • Lock->isLocked() now returns true if the lock is still valid. To get the remaining duration of the lock, use getRemainingLockDuration()
  • Lock->break() and Lock->removeLock() now return void instead of always returning true
  • Lock->$identifier is no longer nullable, but a null value can still be passed in the constructor to use the default identifier
  • Lock->getClient() is now static

@JulianVennen JulianVennen marked this pull request as ready for review April 3, 2025 13:54
@JulianVennen JulianVennen marked this pull request as draft April 3, 2025 16:09
@JulianVennen JulianVennen marked this pull request as ready for review April 4, 2025 12:27
@JulianVennen JulianVennen merged commit 8131cbd into aternosorg:master Apr 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments