Skip to content

a typesafe O(1) queue library for luau

License

Notifications You must be signed in to change notification settings

daolgierd/Queue-luau

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Queue-luau

a typesafe O(1) queue library for luau

Example

All functions are listed in Methods

local queue = require(...)
local foo = queue.new()
foo:push("foo")
foo:push("bar")
foo:push("baz")
local popped = foo:pop()
print(popped) --> 'foo'

Methods

  • :push(value: T) - Add value to queue.
  • :pop() - Remove the first value from queue and return it.
  • :peek() - Returns the first value from queue but does not remove it.
  • :get(index: number?) - If no index provided it will return the full queue in table.
  • :set(index: number, value: T) - Sets the value at given index.
  • :size() - Returns the size of the queue.
  • :clear() - Clears the entire queue.

About

a typesafe O(1) queue library for luau

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages