Skip to content
/ queue Public

An efficient implementation of double ended fifo queues for Elixir, based on Erlang's queue module

License

Notifications You must be signed in to change notification settings

zambal/queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Queue

Simple queue implementation, based on Erlang's queue module, which is an efficient implementation of double ended fifo queues

Differences between Queue and Erlang's queue module are a more Elixir friendly API (subject as first argument) and implementations of the Enumerable, Collectable and Inspect protocols.

Examples

iex> q = Queue.new |> Queue.put(1) |> Queue.put(2)
#Queue<[1, 2]>
iex> Queue.pop(q)
{1, #Queue<[2]>}

iex> Queue.from_list([1,2,3,4]) |> Enum.take_while(&(&1 < 3))
[1, 2]

iex> for n <- 1..4, into: Queue.new, do: n * n
#Queue<[1, 4, 9, 16]>

About

An efficient implementation of double ended fifo queues for Elixir, based on Erlang's queue module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages