Module replayq

Data Types

ack_ref()

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

bytes()

bytes() = non_neg_integer()

config()

config() = #{dir => dir(), seg_bytes => bytes(), mem_only => boolean(), max_total_bytes => bytes()}

count()

count() = non_neg_integer()

dir()

dir() = filename()

filename()

filename() = file:filename_all()

item()

item() = term()

marshaller()

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

q()

abstract datatype: q()

segno()

segno() = pos_integer()

sizer()

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

w_cur()

w_cur() = #{segno := segno(), bytes := bytes(), count := count(), 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
is_empty/1
open/1
peek/1peek the queue front item.
pop/2pop out at least one item from the queue.

Function Details

ack/2

ack(X1::q(), X2::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(X1::q() | w_cur()) -> ok | {error, any()}

committer_loop/2

committer_loop(HeadSegno, Dir) -> any()

count/1

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

is_empty/1

is_empty(Q) -> any()

open/1

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

peek/1

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

peek the queue front item.

pop/2

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

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


Generated by EDoc