Lock & Unlock

This handler (com.rierino.handler.LockEventHandler) provides ability to create locks & unlock them for a given id and a domain.

Handler Parameters

Parameter
Definition
Example
Default

locker

StateLocker class to use for issuing and releasing locks

com.rierino.state.lock.RedisStateLocker

-

timeout

Default milliseconds to wait for acquiring a lock

1000

-

expiry

Default TTL of a lock in milliseconds (-1 for non-expiring locks)

60000

-1

Actions

TryLock

Tries creating a lock and returns whether it was successful:

Field
Definition
Example
Default

inputElement

Json path in payload that has id parameter

parameters

-

outputElement

Json path in payload to return "locked" results

result

-

With the following event metadata parameters:

Parameter
Definition
Example
Default

master

Whether master lock should be used instead of a specific id

true

false

timeout

Milliseconds to wait for acquiring a lock (overrides default)

2000

-

expiry

TTL in milliseconds for lock expiry (overrides default)

10000

-

allowNoLock

Whether failure to hold a lock should return a successful result (returns "locked" value instead of error)

true

false

Unlock

Unlocks an existing lock:

Field
Definition
Example
Default

inputElement

Json path in payload that has id parameter

parameters

-

With the following event metadata parameters:

Parameter
Definition
Example
Default

master

Whether master lock should be used instead of a specific id

true

false

CheckLock

Returns the current status for a lock:

Field
Definition
Example
Default

inputElement

Json path in payload that has id parameter

parameters

-

outputElement

Json path in payload to return "locked" results

result

-

With the following event metadata parameters:

Parameter
Definition
Example
Default

master

Whether master lock should be used instead of a specific id

true

false

Last updated