package miou

  1. Overview
  2. Docs
Composable concurrency primitives for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

miou-0.5.1.tbz
sha256=129339f4a60fc9579ee118d693056caf00be3b68c7a52ea974b91b1f25e4dd63
sha512=5603847cce524c04e9a5dca268fc1050fbf2e4019b0e7fa24ee3d4941c4dce38e17f49b39c7f812634d1ab9b4d0cb02c5103c8c0c644c174df48074763801ffd

doc/miou.backoff/Miou_backoff/index.html

Module Miou_backoffSource

Randomized exponential backoff mechanism.

Sourcetype t

Type of backoff values.

Sourceval max_wait_log : int

Logarithm of the maximum allowed value for wait.

Sourceval create : ?lower_wait_log:int -> ?upper_wait_log:int -> unit -> t

create creates a backoff value. upper_wait_log, lower_wait_log override the logarithmic upper and lower bound on the number of spins executed by once.

Sourceval default : t

default is equivalent to create ().

Sourceval once : t -> t

once b executes one random wait and returns a new backoff with logarithm of the current maximum value incremented unless it is already at upper_wait_log of b.

Note that this uses the default Stdlib Random per-domain generator.

Sourceval reset : t -> t

reset b returns a backoff equivalent to b except with current value set to the lower_wait_log of b.

Sourceval get_wait_log : t -> int

get_wait_log b returns logarithm of the maximum value of wait for next once.