grisp_updater_progress behaviour (grisp_updater v2.3.0)

View Source

Summary

Callbacks

Successful completion notification.

Fatal error: finalize and notify the caller.

Initialize a progress reporter. The returned State is passed to all progress_* callbacks.

Called frequently as the update proceeds. Should return quickly.

Optional warning hook for non-fatal conditions.

Types

statistics()

-type statistics() ::
          #{start_time := non_neg_integer(),
            blocks_total := non_neg_integer(),
            blocks_checked := non_neg_integer(),
            blocks_loading := non_neg_integer(),
            blocks_loaded := non_neg_integer(),
            blocks_retries := non_neg_integer(),
            blocks_written := non_neg_integer(),
            data_total := non_neg_integer(),
            data_checked := non_neg_integer(),
            data_loaded := non_neg_integer(),
            data_skipped := non_neg_integer(),
            data_written := non_neg_integer()}.

Callbacks

progress_done(State, Statistics)

-callback progress_done(State :: term(), Statistics :: statistics()) -> ok.

Successful completion notification.

progress_error(State, Statistics, Reason, Msg)

-callback progress_error(State :: term(),
                         Statistics :: statistics(),
                         Reason :: term(),
                         Msg :: binary() | undefined) ->
                            ok.

Fatal error: finalize and notify the caller.

progress_init(Opts)

-callback progress_init(Opts :: map()) -> {ok, State :: term()} | {error, term()}.

Initialize a progress reporter. The returned State is passed to all progress_* callbacks.

progress_update(State, Statistics)

-callback progress_update(State :: term(), Statistics :: statistics()) -> {ok, State :: term()}.

Called frequently as the update proceeds. Should return quickly.

progress_warning(State, Reason, Msg)

-callback progress_warning(State :: term(), Reason :: term(), Msg :: binary() | undefined) ->
                              {ok, State :: term()}.

Optional warning hook for non-fatal conditions.

Functions

options()

progress_done(State, Statistics)

progress_error(State, Statistics, Reason, Msg)

progress_init(Opts)

progress_update(State, Statistics)

progress_warning(State, Reason, Msg)

wait/2