Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Configures component by passing configuration parameters.
configuration parameters to be set.
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Releases prevously acquired lock by its key.
(optional) transaction id to trace execution through call chain.
a unique lock key to release.
callback function that receives error or null for success.
Sets references to dependent components.
references to locate the component dependencies.
Makes a single attempt to acquire a lock by its key. It returns immediately a positive or negative result.
(optional) transaction id to trace execution through call chain.
a unique lock key to acquire.
a lock timeout (time to live) in milliseconds.
callback function that receives a lock result or error.
Generated using TypeDoc
Distributed lock that implemented based on Memcaches caching service.
The current implementation does not support authentication.
Configuration parameters
References
*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connectionExample
let lock = new MemcachedLock(); lock.configure(ConfigParams.fromTuples( "host", "localhost", "port", 11211 )); lock.open("123", (err) => { ... }); lock.acquire("123", "key1", (err) => { if (err == null) { try { // Processing... } finally { lock.releaseLock("123", "key1", (err) => { // Continue... }); } } });