package kcas

  1. Overview
  2. Docs

Module type Kcas.BackoffSource

Backoff

Suspend domains with exponential backoff.

Sourcetype t

The type of backoff value

Sourceval create : ?max:int -> unit -> t

create ~max:maxv () returns a backoff value, which when waited upon, suspends the calling domain for x milliseconds, where x is the current value of the backoff. The backoff value x is doubled after every wait upto a maximum of maxv milliseconds. The default maximum is 32 milliseconds. The initial backoff is 1 millisecond.

Sourceval once : t -> unit

once b suspends the current domain for x milliseconds, where x is the current value of the backoff.

Sourceval reset : t -> unit

Resets the backoff clock to 1 millisecond.

OCaml

Innovation. Community. Security.