Global

Methods

(async) decrement(pool) → {doneResponse}

Source:

decrement will decrement the counter by 1 for the specified pool

Parameters:
Name Type Description
pool String
Returns:

response contains decremented count.

Type
doneResponse

(async) deleteUuid(uuid)

Source:

deleteUuid removes the uuid record from the uuid table.

Parameters:
Name Type Description
uuid string

(async) done(pool, uuid) → {doneResponse}

Source:

done is used to notify ConnectionLifeguard that you no longer need a database connection. done attempts to remove the uuid from the uuid table, then decrements the pool counter.

Parameters:
Name Type Description
pool String

The name of the pool your request was for.

uuid String

The uuid that was given to you when your request was approved.

Returns:

response object is returned with decremented count.

Type
doneResponse

getExpireAt() → {number}

Source:

getExpireAt produces epochSeconds equaling now + 2 minutes

Returns:

epochSeconds the number of seconds elapsed since 1970-01-01T00:00:00Z

Type
number

(async) insertUuid(uuid, pool)

Source:

insertUuid inserts a record into the uuid table.

Parameters:
Name Type Description
uuid string
pool string

(async) requestApproval(pool) → {approvalResponse}

Source:

create creates a new entry for the record passed in.

Parameters:
Name Type Description
pool String

The record entry to create

Returns:

response object containing your request data.

Type
approvalResponse

(async) sender(uuid, pool)

Source:

This places a message in a queue that is delayed by a specified number of seconds. Once the message becomes visible it is consumed by a lambda that will remove the uuid record and decrement the pool counter.

Parameters:
Name Type Description
uuid string
pool string

Type Definitions

approvalResponse

Source:
Properties:
Name Type Description
approved boolean

Is true when the request was approved. Else it is false.

count number

Current count of the pool.

uuid string

The unique identifier created when the request is approved.

Type:
  • object

doneResponse

Source:
Properties:
Name Type Description
count number

the current count after decrementing

Type:
  • object