exqueue v0.1.0 RTQueue View Source

An elixir realtime queue implement.

Link to this section Summary

Types

q()

The q type stands for the realtime data for a RTQueue

The state type in the RTQueue module stands for the reverse state of the queue

t()

The t type stands for the RTQueue

Functions

Return true when the queue is empty, false when the queue is not empty

Get the front element of a queue

Return an empty queue

Pop the front element of a queue

Push an element to the back of a queue

Return the size of a queue

Link to this section Types

Link to this type q() View Source
q() :: {list, non_neg_integer, state, list, non_neg_integer}

The q type stands for the realtime data for a RTQueue.

Link to this type state() View Source
state ::
  :Empty |
  {:Reverse, non_neg_integer, list, list, list, list} |
  {:Concat, non_neg_integer, list, list} |
  {:Done, list}

The state type in the RTQueue module stands for the reverse state of the queue.

Link to this type t() View Source
t() :: %RTQueue{realtime: q}

The t type stands for the RTQueue.

Link to this section Functions

Link to this function empty?(queue) View Source
empty?(t) :: boolean

Return true when the queue is empty, false when the queue is not empty.

Link to this function front(queue) View Source
front(t) :: any

Get the front element of a queue.

Return an empty queue.

Pop the front element of a queue.

Link to this function push(queue, x) View Source
push(t, any) :: t

Push an element to the back of a queue.

Link to this function size(queue) View Source
size(t) :: non_neg_integer

Return the size of a queue.