The refresh
method will upadte ttl
of lock if it matches the given key
, given owner
and is expireable.
LOCK_REFRESH_RESULT.UNOWNED_REFRESH
: The lock doesn't exist or is owned by a different owner.LOCK_REFRESH_RESULT.UNEXPIRABLE_KEY
: The lock is owned by the same owner but cannot be refreshed because it's unexpirable.LOCK_REFRESH_RESULT.REFRESHED
: The lock is owned by the same owner and its ttl has been updated.
Note the
MemoryLockAdapter
is limited to single process usage and cannot be shared across multiple servers or different processes. This adapter is meant to be used for testing.IMPORT_PATH:
"@daiso-tech/core/lock/adapters"