-
Notifications
You must be signed in to change notification settings - Fork 9
AnyLock
Mykhailo Stadnyk edited this page Nov 23, 2020
·
2 revisions
Globals / AnyLock
Lock implementation interface to follow
- AnyLock
▸ acquire(): Promise<boolean>
Implements lock acquire logic asynchronously
Returns: Promise<boolean>
▸ destroy(): Promise<void>
Implements lock safe destruction asynchronously
Returns: Promise<void>
▸ init(): Promise<void>
Must initialize lock asynchronously
Returns: Promise<void>
▸ isAcquired(): boolean
Implements lock acquire verification asynchronously
Returns: boolean
▸ onRelease(handler
: (channel: string) => void): void
Implements lock release handler upset
Name | Type | Description |
---|---|---|
handler |
(channel: string) => void |
Returns: void
▸ release(): Promise<void>
Implements lock release logic asynchronously
Returns: Promise<void>