View Source ExWal.Recycler.ETS (ex_wal v0.3.0)

An ETS based WAL file recycler.

Summary

Types

@type log() :: ExWal.Models.VirtualLog.t()
@type log_num() :: ExWal.Models.VirtualLog.log_num()
@type p() :: GenServer.name() | pid()
@type t() :: %ExWal.Recycler.ETS{
  capacity: non_neg_integer(),
  logs: [log()],
  max: log_num(),
  min: log_num(),
  name: Agent.name(),
  size: non_neg_integer()
}

Functions

@spec add(name :: p(), log :: log()) :: boolean()

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec get(name :: p()) :: t()
@spec get_min(name :: p()) :: log_num()
Link to this function

handle_initialize(state, capacity)

View Source
Link to this function

handle_set_min(state, log_num)

View Source
Link to this function

initialize(name, capacity)

View Source
@spec initialize(name :: p(), capacity :: non_neg_integer()) :: :ok
@spec peek(name :: p()) :: log() | nil
@spec pop(name :: p()) :: log() | nil
@spec set_min(name :: p(), log_num :: log_num()) :: :ok