R6
class for throttle configuration.
Details
See crew_throttle()
.
See also
Other throttle:
crew_throttle()
Active bindings
seconds_max
See
crew_throttle()
.seconds_min
See
crew_throttle()
.seconds_start
See
crew_throttle()
.base
See
crew_throttle()
.seconds_interval
Current wait time interval.
polled
Positive numeric of length 1, millisecond timestamp of the last time
poll()
returnedTRUE
.NULL
ifpoll()
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_max
See
crew_throttle()
.seconds_min
See
crew_throttle()
.seconds_start
See
crew_throttle()
.base
See
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] TRUE
throttle$poll()
#> [1] FALSE
## ------------------------------------------------
## Method `crew_class_throttle$new`
## ------------------------------------------------
throttle <- crew_throttle(seconds_max = 1)
throttle$poll()
#> [1] TRUE
throttle$poll()
#> [1] FALSE