Skip to main content

Pop From Queue Back (LCC.kvdb.queue.pop_back)

Signature

value, err = LCC.kvdb.queue.pop_back(name, timeout?)

Parameters

  • name
    String. Queue name (non-empty, max 256 bytes).
  • timeout
    Number, optional. Request timeout in seconds, default 60.

Returns

  • value
    String. Item removed from the tail; nil when the queue is empty.
  • err
    String or nil. Returns 'not found' when the queue is empty or missing.

Notes

Removes and returns the last element from the queue.
Handy for LIFO-style consumption.

Example

local value, err = LCC.kvdb.queue.pop_back("pending")
if value then
print("Processing latest task", value)
end