Loads a file from the filesystem without blocking the caller.
Summary
Types
-type event() :: event_load_attempt_started() | event_load_attempt_dismissed().
-type event_load_attempt_dismissed() :: {load_attempt_dismissed, source()}.
-type event_load_attempt_started() :: {load_attempt_started, source()}.
-type path() :: file:filename_all().
-type source() :: {cache | filesystem, path()}.
-opaque state()
-type success() :: #{modified_on := calendar:datetime(), content := binary()}.
Functions
-spec init([InitArg, ...]) -> {ok, state()} when InitArg :: OwnerPid | Source | PrevModificationDT, OwnerPid :: pid(), Source :: source(), PrevModificationDT :: calendar:datetime() | unknown.
-spec start_link(source(), calendar:datetime() | unknown) -> {ok, pid()}.