Module replayq

Data Types

ack_ref()

ack_ref() = '?NOTHING_TO_ACK' | {segno(), ID::pos_integer()}

bytes()

bytes() = non_neg_integer()

bytes_limit()

bytes_limit() = bytes() | {at_most | at_least, bytes()}

config()

config() = #{dir => dir(), seg_bytes => bytes(), mem_only => boolean(), max_total_bytes => bytes(), offload => boolean() | {true, volatile}, sizer => sizer(), marshaller => marshaller()}

count()

count() = non_neg_integer()

dir()

dir() = filename()

filename()

filename() = file:filename_all()

item()

item() = term()

marshaller()

marshaller() = fun((item()) -> binary())

next_stop_before_state()

next_stop_before_state() = term()

q()

abstract datatype: q()

segno()

segno() = pos_integer()

sizer()

sizer() = fun((item()) -> bytes())

stop_before_func()

stop_before_func() = fun((item(), stop_before_initial_state()) -> true | next_stop_before_state())

stop_before_initial_state()

stop_before_initial_state() = term()

w_cur()

w_cur() = #{segno := segno(), bytes := bytes(), count := count(), fd := '?NO_FD' | file:fd()}

Function Index

ack/2Asynch-ly write the consumed item Segment number + ID to a file.
append/2
bytes/1
close/1
committer_loop/2
count/1
default_marshaller/1
default_sizer/1
default_stop_before_func/2
do_read_items/2
is_empty/1
is_mem_only/1
open/1
overflow/1Returns number of bytes the size of the queue has exceeded total bytes limit.
peek/1peek the queue front item.
pop/2pop out at least one item from the queue.

Function Details

ack/2

ack(X1::q(), AckRef::ack_ref()) -> ok

Asynch-ly write the consumed item Segment number + ID to a file.

append/2

append(Q::q(), Items0::[item()]) -> q()

bytes/1

bytes(X1::q()) -> bytes()

close/1

close(Q::q() | w_cur()) -> ok | {error, any()}

committer_loop/2

committer_loop(ReaderSegno, Dir) -> any()

count/1

count(X1::q()) -> count()

default_marshaller/1

default_marshaller(I) -> any()

default_sizer/1

default_sizer(I) -> any()

default_stop_before_func/2

default_stop_before_func(Item, State) -> any()

do_read_items/2

do_read_items(Dir, Segno) -> any()

is_empty/1

is_empty(Q) -> any()

is_mem_only/1

is_mem_only(X1::q()) -> boolean()

open/1

open(C::config()) -> q()

overflow/1

overflow(X1::q()) -> integer()

Returns number of bytes the size of the queue has exceeded total bytes limit. Result is negative when it is not overflow.

peek/1

peek(X1::q()) -> empty | item()

peek the queue front item.

pop/2

pop(Q::q(), Opts::#{bytes_limit => bytes_limit(), count_limit => count(), stop_before => {stop_before_func(), stop_before_initial_state()}}) -> {q(), ack_ref(), [item()]}

pop out at least one item from the queue. volume limited by bytes_limit and count_limit.


Generated by EDoc