Lock
our locking class
Static Member Summary
Static Public Members | ||
public static get |
nextExpiry: * gets the next closests expiry timestamp in MS |
Static Method Summary
Static Public Methods | ||
public static |
creates a new Lock instance |
Constructor Summary
Public Constructor | ||
public |
constructor(key: <type>, options: <type>) constructor for a Lock class |
Method Summary
Public Methods | ||
public |
polls until the instance obtains a lock |
|
public |
attributes(): Object returns attributes for a given Lock update |
|
public |
genId(): * |
|
public |
get(): Thinky:Query base Query we inherit from |
|
public |
releases the lock on the current instance |
|
public |
replace Query for replacing a lock instance in REQL |
|
public |
synchronize(fn: Function): Promise obtains a lock and then runs an unary function that receives a |
|
public |
|
|
public |
logical validators |
|
public |
touches an acquired lock |
|
public |
tries to attain a Lock on the current instance |
|
public |
update Query for a lock update REQL operation |
Static Public Members
public static get nextExpiry: * source
gets the next closests expiry timestamp in MS
Properties:
Name | Type | Attribute | Description |
nextExpiry | Integer |
Static Public Methods
Public Constructors
public constructor(key: <type>, options: <type>) source
constructor for a Lock class
Params:
Name | Type | Attribute | Description |
key | <type> | The lock key |
|
options | <type> | options for the lock |
Public Methods
public replace(replacer: Function): * source
replace Query for replacing a lock instance in REQL
Params:
Name | Type | Attribute | Description |
replacer | Function | function that implements the REQL replace |
Return:
* |
public synchronize(fn: Function): Promise source
obtains a lock and then runs an unary function that receives a done
callback
Params:
Name | Type | Attribute | Description |
fn | Function | the function to run after a lock is obtained |