ftpfilez_backoff (ftpfilez v2.3.0)

View Source

Short-lived cache for connection/login failures.

This prevents a queue with many jobs for the same FTP credentials from opening many connections that are very likely to fail with the same error. Only connection setup errors are cached; file operation errors are not.

Summary

Types

key/0

-type key() :: {binary(), pos_integer(), binary(), binary()}.

Functions

code_change(OldVersion, State, Extra)

forget(Host, Port, Username, Password)

-spec forget(Host, Port, Username, Password) -> ok
                when
                    Host :: string() | binary(),
                    Port :: pos_integer(),
                    Username :: string() | binary(),
                    Password :: string() | binary().

handle_call(Msg, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

init(_)

lookup(Host, Port, Username, Password)

-spec lookup(Host, Port, Username, Password) -> none | {error, term()}
                when
                    Host :: string() | binary(),
                    Port :: pos_integer(),
                    Username :: string() | binary(),
                    Password :: string() | binary().

remember(Host, Port, Username, Password, Error)

-spec remember(Host, Port, Username, Password, Error) -> ok
                  when
                      Host :: string() | binary(),
                      Port :: pos_integer(),
                      Username :: string() | binary(),
                      Password :: string() | binary(),
                      Error :: {error, term()}.

start_link()

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

terminate(Reason, State)