R6 class for throttle configuration.
Details
See crew_throttle().
See also
Other throttle:
crew_throttle()
Active bindings
seconds_maxSee
crew_throttle().seconds_minSee
crew_throttle().seconds_startSee
crew_throttle().baseSee
crew_throttle().seconds_intervalCurrent wait time interval.
polledPositive numeric of length 1, millisecond timestamp of the last time
poll()returnedTRUE.NULLifpoll()was never called on the current object.
Methods
Method new()
Throttle constructor.
Usage
crew_class_throttle$new(
seconds_max = NULL,
seconds_min = NULL,
seconds_start = NULL,
base = NULL
)Arguments
seconds_maxSee
crew_throttle().seconds_minSee
crew_throttle().seconds_startSee
crew_throttle().baseSee
crew_throttle().
Examples
throttle <- crew_throttle(seconds_max = 1)
throttle$poll()
throttle$poll()Method reset()
Reset the throttle object so the next poll() returns
TRUE, and reset the wait time interval to its initial value.
Method update()
Reset the throttle when there is activity and decelerate it gradually when there is no activity.
Examples
throttle <- crew_throttle(seconds_max = 1)
throttle$poll()
#> [1] FALSE
throttle$poll()
#> [1] FALSE
## ------------------------------------------------
## Method `crew_class_throttle$new`
## ------------------------------------------------
throttle <- crew_throttle(seconds_max = 1)
throttle$poll()
#> [1] FALSE
throttle$poll()
#> [1] FALSE