Push To Queue Front (LCC.kvdb.queue.push_front)
Signature
size, err = LCC.kvdb.queue.push_front(name, value, timeout?)
Parameters
- name
String. Queue name (non-empty, max256bytes). - value
String, or a continuous string array. Strings must be valid UTF-8. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- size
Number. Queue length after the push;nilon failure. - err
String ornil. Error message when the call fails.
Notes
Pushes an item onto the head of the queue.
Batch pushes preserve array order. For example,{"a", "b"}becomes the new heada, b, .... Queue names cannot be empty.
Example
local size, err = LCC.kvdb.queue.push_front("pending", "task#1")
if size then
LCC.log(1, "Queue size", size)
end
local batch_size, batch_err = LCC.kvdb.queue.push_front("pending", {"task#2", "task#3"})