View Source grisp_updater_progress behaviour (grisp_updater v2.1.1)

Summary

Types

statistics/0

-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/2

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

progress_error/4

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

progress_init/1

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

progress_update/2

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

progress_warning/3

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

Functions

options()

progress_done(State, Stats)

progress_error(State, Stats, Reason)

progress_init(Opts)

progress_update(State, Stats)

progress_warning(State, Msg, Reason)

wait(Proc, _)