map_queue v0.2.0 MapQueue
MapQueue is an implemenation of a queue with a single map as the underlying data structure.
The benefit of using a MapQueue over a list is that appending to the tail of
a list ++ can become quite an expensive operation when the list is large.
With MapQueue adding or removing items from the queue is roughtly as fast as the same operation on a Map.
MapQueue keeps track of items in a map with integers as keys, and also tracks
the highest (last) and lowest (first) items in the map.
Since each item in a MapQueue is tracked by an integer, the memory consumption of
a MapQueue will be higher than that of an equivalent list or Erlang :queue.
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
pop(queue, count)
pop(MapQueue.t(), non_neg_integer()) :: {list(), MapQueue.t()}
Link to this function
pop_rear(queue, count)
pop_rear(MapQueue.t(), non_neg_integer()) :: {list(), MapQueue.t()}
Link to this function
slice(map_queue, index, amount)
slice(MapQueue.t(), any(), any()) :: MapQueue.t()