A bounded history of rows that have scrolled off the top of the screen.
Rows are pushed one at a time and read newest-last. The bound is a row count; once it is reached, each push drops the oldest row.
Summary
Functions
Discard every held row.
An empty history holding at most limit rows.
Append a row, dropping the oldest when the limit is reached.
Append several rows, oldest first.
The newest count rows, oldest first.
How many rows are held.
Every held row, oldest first.
Types
@type t() :: %ETee.Scrollback{ count: non_neg_integer(), limit: non_neg_integer(), rows: :queue.queue() }
Functions
Discard every held row.
@spec new(non_neg_integer()) :: t()
An empty history holding at most limit rows.
Append a row, dropping the oldest when the limit is reached.
Append several rows, oldest first.
@spec recent(t(), non_neg_integer()) :: [term()]
The newest count rows, oldest first.
@spec size(t()) :: non_neg_integer()
How many rows are held.
Every held row, oldest first.