crew_class_throttle {crew} | R Documentation |
R6
throttle class.R6
class for throttle configuration.
See crew_throttle()
.
seconds_interval
Positive numeric of length 1, throttling interval in seconds.
polled
Positive numeric of length 1,
millisecond timestamp of the last time poll()
returned TRUE
.
NULL
if poll()
was never called on the current object.
new()
Throttle constructor.
crew_class_throttle$new(seconds_interval = NULL)
seconds_interval
Throttling interval in seconds.
An R6
object with throttle configuration.
throttle <- crew_throttle(seconds_interval = 0.5) throttle$poll() throttle$poll()
validate()
Validate the object.
crew_class_throttle$validate()
NULL
(invisibly).
poll()
Poll the throttler.
crew_class_throttle$poll()
TRUE
if poll()
did not return TRUE
in the last
seconds_interval
seconds, FALSE
otherwise.
reset()
Reset the throttle object so the next poll()
returns
TRUE
.
crew_class_throttle$reset()
NULL
(invisibly).
Other throttle:
crew_throttle()
throttle <- crew_throttle(seconds_interval = 0.5)
throttle$poll()
throttle$poll()
## ------------------------------------------------
## Method `crew_class_throttle$new`
## ------------------------------------------------
throttle <- crew_throttle(seconds_interval = 0.5)
throttle$poll()
throttle$poll()