View Source ConnGRPC.Backoff behaviour (ConnGRPC v0.2.0)

Behaviour for implementing custom backoff.

Link to this section Summary

Callbacks

Generate backoff delay and new state. This is called each time that we fail to connect.

Initializes the backoff state. This is called when the channel process is started.

Reset backoff state. This is called when connecting succeeds.

Link to this section Callbacks

@callback backoff(state :: any()) :: {delay :: non_neg_integer(), state :: any()}

Generate backoff delay and new state. This is called each time that we fail to connect.

@callback new(opts :: any()) :: state :: any()

Initializes the backoff state. This is called when the channel process is started.

@callback reset(state :: any()) :: state :: any()

Reset backoff state. This is called when connecting succeeds.