View Source Qu.FIFO (qu v0.1.0)

FIFO queue implementation.

Summary

Types

@type item() :: any()
@type max_size() :: pos_integer() | nil
@type size() :: non_neg_integer()
@type t() :: %Qu.FIFO{
  max_size: max_size(),
  read: [item()],
  size: non_neg_integer(),
  write: [item()]
}

Functions

@spec new(max_size()) :: t()
@spec peek(t()) :: {:ok, item()} | :error
@spec pop(t()) :: {:ok, item(), t()} | :error
@spec put(t(), item()) :: {:ok, t()} | :error
@spec size(t()) :: size()