Skip to content

AnyLock

Mykhailo Stadnyk edited this page Jan 2, 2020 · 2 revisions

Interface: AnyLock

Lock implementation interface to follow

Hierarchy

  • AnyLock

Implemented by

Index

Methods

Methods

acquire

acquire(): Promise‹boolean›

Implements lock acquire logic asynchronously

Returns: Promise‹boolean›


destroy

destroy(): Promise‹void›

Implements lock safe destruction asynchronously

Returns: Promise‹void›


init

init(): Promise‹void›

Must initialize lock asynchronously

Returns: Promise‹void›


isAcquired

isAcquired(): boolean

Implements lock acquire verification asynchronously

Returns: boolean


onRelease

onRelease(handler: function): void

Implements lock release handler upset

Parameters:

handler: function

▸ (channel: string): void

Parameters:

Name Type
channel string

Returns: void


release

release(): Promise‹void›

Implements lock release logic asynchronously

Returns: Promise‹void›

Clone this wiki locally