View Source locus_filesystem_load (locus v2.3.7)

Loads a file from the filesystem without blocking the caller

Link to this section Summary

Link to this section Types

Specs

Link to this type

event_load_attempt_dismissed/0

View Source

Specs

event_load_attempt_dismissed() :: {load_attempt_dismissed, source()}.
Link to this type

event_load_attempt_started/0

View Source

Specs

event_load_attempt_started() :: {load_attempt_started, source()}.

Specs

msg() ::
    {event, event()} |
    {finished, {success, success()}} |
    {finished, dismissed} |
    {finished, {error, not_found}} |
    {finished, {error, term()}}.

Specs

path() :: nonempty_string().

Specs

source() :: {cache | filesystem, path()}.

Specs

state() :: #state{}.

Specs

success() :: #{modified_on := calendar:datetime(), content := binary()}.

Link to this section Functions

Link to this function

code_change(OldVsn, State, Extra)

View Source

Specs

code_change(term(), state(), term()) -> {ok, state()}.
Link to this function

handle_call(Call, From, State)

View Source

Specs

handle_call(term(), {pid(), reference()}, state()) -> {stop, unexpected_call, state()}.
Link to this function

handle_cast(Cast, State)

View Source

Specs

handle_cast(term(), state()) -> {stop, unexpected_cast, state()}.
Link to this function

handle_info(Info, State)

View Source

Specs

handle_info(term(), state()) -> {stop, normal, state()} | {stop, unexpected_info, state()}.

Specs

init([InitArg, ...]) -> {ok, state()}
        when
            InitArg :: OwnerPid | Source | PrevModificationDT,
            OwnerPid :: pid(),
            Source :: source(),
            PrevModificationDT :: calendar:datetime() | unknown.
Link to this function

start_link(Source, PrevModificationDT)

View Source

Specs

start_link(source(), calendar:datetime() | unknown) -> {ok, pid()}.
Link to this function

terminate(Reason, State)

View Source

Specs

terminate(term(), state()) -> ok.