Utilities · zero-dependency · MIT

larzqueue

A FIFO queue, named so intent reads clearly.

Built on a plain list - enqueue/dequeue/peek/is_empty/size, the classic FIFO vocabulary. dequeue() is O(n) (a real list shift via slicing), which is fine for the small, script-sized queues this language is meant for - not a ring-buffer for a million-item hot loop.

larzscript pkg install queue
View on GitHub →Learn the stack

What you get

Try it

import "queue" as queue
let q = queue.new()
queue.enqueue(q, 1); queue.enqueue(q, 2); queue.enqueue(q, 3)
print(queue.dequeue(q))
print(queue.peek(q))
print(queue.is_empty(q))
print(queue.size(q))
Output
1
2
false
2

Why it's in the Larz Stack

larzqueue is a real Larzscript package (larzscript pkg install queue) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.