exbackoff v0.0.1 Exbackoff

Summary

Functions

Starts a timer from the `backoff()’ argument, using erlang:start_timer/3. No reference tracking is done, and this is left to the user. This function is purely a convenience function

Reads the current backoff value

Just do the increments by hand!

init function when the user doesn’t feel like using a timer provided by this library

init function when the user feels like using a timer provided by this library

Just do the random increments by hand! Choose delay uniformly from [0.5 * Time, 1.5 * Time] as recommended in: Sally Floyd and Van Jacobson, The Synchronization of Periodic Routing Messages, April 1994 IEEE/ACM Transactions on Networking. http://ee.lbl.gov/papers/sync_94.pdf

Swaps between the states of the backoff

Types

backoff :: %Exbackoff{current: pos_integer, dest: pid, max: max, start: pos_integer, type: :normal | :jitter, value: any}

Functions

fail(exbackoff)

Specs

fail(backoff) :: {pos_integer, backoff}
fire(exbackoff)

Specs

fire(backoff) :: reference

Starts a timer from the `backoff()’ argument, using erlang:start_timer/3. No reference tracking is done, and this is left to the user. This function is purely a convenience function.

get(exbackoff)

Specs

get(backoff) :: pos_integer

Reads the current backoff value.

increment(n)

Specs

increment(pos_integer) :: pos_integer

Just do the increments by hand!

increment(n, max)

Specs

increment(pos_integer, pos_integer) :: pos_integer
init(start, max)

Specs

init(pos_integer, max) :: backoff

init function when the user doesn’t feel like using a timer provided by this library

init(start, max, dest, value)

Specs

init(pos_integer, max, pid | nil, any | nil) :: backoff

init function when the user feels like using a timer provided by this library

rand_increment(n)

Specs

rand_increment(pos_integer) :: pos_integer

Just do the random increments by hand! Choose delay uniformly from [0.5 * Time, 1.5 * Time] as recommended in: Sally Floyd and Van Jacobson, The Synchronization of Periodic Routing Messages, April 1994 IEEE/ACM Transactions on Networking. http://ee.lbl.gov/papers/sync_94.pdf

rand_increment(n, max)

Specs

rand_increment(pos_integer, pos_integer) :: pos_integer
succeed(exbackoff)

Specs

succeed(backoff) :: {pos_integer, backoff}
type(exbackoff, atom)

Specs

type(backoff, :normal | :jitter) :: backoff

Swaps between the states of the backoff.