Airbag.Buffer (airbag v0.1.0)

Link to this section Summary

Link to this section Types

Link to this type

buffer_name()

@type buffer_name() :: atom()
@type opt() ::
  {:partition_count, pos_integer()}
  | {:total_memory_threshold, pos_integer() | :infinity}
  | {:hash_by, (term() -> term())}
  | {:partition_ets_opts, list()}
@type opts() :: [opt()]
Link to this type

partition_index()

@type partition_index() :: pos_integer()
@type t() :: %Airbag.Buffer{
  hash_by: term(),
  name: term(),
  partition_count: term(),
  private: term(),
  total_memory_threshold: term()
}

Link to this section Functions

Link to this function

dequeue(buffer_or_buffer_name, partition_index, opts \\ [])

@spec dequeue(t() | buffer_name(), partition_index(), [{:limit, pos_integer()}]) :: [
  any()
]
Link to this function

enqueue(buffer_name, term)

@spec enqueue(t() | buffer_name(), term()) ::
  {:ok, partition_index()} | {:error, :threshold_reached}
Link to this function

info!(buffer_name, opts \\ [])

@spec info!(buffer_name(), [{:only, :buffer_meta}]) :: t()
Link to this function

new(buffer_name, opts \\ [])

@spec new(buffer_name(), opts()) :: t()