Home Reference Source Repository
public class | source

Lock

A class providing a synchronisation lock

Constructor Summary

Public Constructor
public

constructor($q: *, $timeout: *)

Member Summary

Public Members
public

$q: *

public
public

lockMap: *

Method Summary

Public Methods
public

getLock(key: *, failOnLocked: *): *

public

returnLock(key: *, returnData: *, resolve: *): *

Returns a aquired lock

Public Constructors

public constructor($q: *, $timeout: *) source

Params:

NameTypeAttributeDescription
$q *
$timeout *

Public Members

public $q: * source

public $timeout: * source

public lockMap: * source

Public Methods

public getLock(key: *, failOnLocked: *): * source

Params:

NameTypeAttributeDescription
key *

They key we are locking on

failOnLocked *

Flag if the promise should immediatly reject if we are not exclusively locking

Return:

*

public returnLock(key: *, returnData: *, resolve: *): * source

Returns a aquired lock

Params:

NameTypeAttributeDescription
key *

The Key of the lock to return

returnData *

the data to return with the resolved promise

resolve *

If true, the promise will be resolve, if false, a rejected promise will be returns

Return:

*