package ego

  1. Overview
  2. Docs

The module Backoff implements an exponential backoff scheduler. The scheduler works by tracking a maximum match limit, and (BEB) banning rules which exceed their limit.

type t

Represents the persistent state of the scheduler - it really just tracks the match limit and ban_length parameters chosen by for this particular instantiation.

type data

Represents the metadata about rules tracked by the scheduler.

val with_params : match_limit:int -> ban_length:int -> t

with_params ~match_limit ~ban_length creates a new backoff scheduler with the threshold for banning rules set to match_limit and the length for which rules are banned set to ban_length.

val default : unit -> t

default () returns a default instance of the backoff scheduler with the threshold for banning rules set to 1_000 and the initial ban_length set to 5.

val create_rule_metadata : t -> 'a -> data
val should_stop : t -> int -> data Iter.t -> bool
val guard_rule_usage : ('node, 'analysis, 'data, 'permission) egraph -> t -> data -> int -> (unit -> (Id.t * Id.t StringMap.t) Iter.t) -> (Id.t * Id.t StringMap.t) Iter.t
OCaml

Innovation. Community. Security.