View Source ExWal.LogReader protocol (ex_wal v0.3.0)

A LogReader takes an ordered sequence of physical WAL files ("segments"), providing a merged view of the WAL's logical contents. It's responsible for filtering duplicate records which may be shared by the tail of a segment file and the head of its successor.

Summary

Types

t()

All the types that implement this protocol.

Functions

next returns a next binary written to wal. It returns io.EOF if there are no more records.

recovery clear the rest part of current block and move to next block.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

@spec next(t()) :: {:ok, bytes :: binary()} | :eof | {:error, reason :: term()}

next returns a next binary written to wal. It returns io.EOF if there are no more records.

@spec recovery(t()) :: :ok

recovery clear the rest part of current block and move to next block.

@spec stop(t()) :: :ok