espool (espool v0.1.0)

View Source

Summary

Types

item/0

-type item() :: term().

name/0

-type name() :: gen_statem:server_ref().

opt/0

-type opt() ::
          {name, gen_statem:server_name()} |
          {dir, file:filename_all()} |
          {sync_interval, timeout()} |
          {snapshot_interval, timeout()}.

opts/0

-type opts() :: [opt()].

sqn/0

-type sqn() :: pos_integer().

Functions

ack(Name, Sqn)

-spec ack(name(), sqn()) -> ok | {error, term()}.

callback_mode()

code_change(OldVsn, State, Data, Extra)

dump(Name)

-spec dump(name()) -> [{sqn(), item()}].

fetch(Name)

-spec fetch(name()) -> {ok, {sqn(), item()}} | {error, term()}.

flush(Name)

-spec flush(name()) -> {ok, [item()]} | {error, term(), [item()]}.

handle_event(Type, Content, State, Data)

init(_)

put(Name, Item)

-spec put(name(), item()) -> {ok, sqn()} | {error, term()}.

size(Name)

-spec size(name()) -> non_neg_integer().

snapshot(Name)

-spec snapshot(name()) -> ok | {error, term()}.

start(Opts)

-spec start(opts()) -> {ok, pid()} | ignore | {error, term()}.

start(Opts, StatemOpts)

-spec start(opts(), [gen_statem:start_opt()]) -> {ok, pid()} | ignore | {error, term()}.

start_link(Opts)

-spec start_link(opts()) -> {ok, pid()} | ignore | {error, term()}.

start_link(Opts, StatemOpts)

-spec start_link(opts(), [gen_statem:start_opt()]) -> {ok, pid()} | ignore | {error, term()}.

start_monitor(Opts)

-spec start_monitor(opts()) -> {ok, {pid(), reference()}} | ignore | {error, term()}.

start_monitor(Opts, StatemOpts)

-spec start_monitor(opts(), [gen_statem:start_opt()]) ->
                       {ok, {pid(), reference()}} | ignore | {error, term()}.

stop(Name)

-spec stop(name()) -> ok.

sync(Name)

-spec sync(name()) -> ok | {error, term()}.

terminate(Reason, State, Data)