crew_class_throttle {crew} | R Documentation |
R6
throttle class.
Description
R6
class for throttle configuration.
Details
See crew_throttle()
.
Active bindings
seconds_interval
Positive numeric of length 1, throttling interval in seconds.
polled
Positive numeric of length 1, millisecond timestamp of the last time
poll()
returnedTRUE
.NULL
ifpoll()
was never called on the current object.
Methods
Public methods
Method new()
Throttle constructor.
Usage
crew_class_throttle$new(seconds_interval = NULL)
Arguments
seconds_interval
Throttling interval in seconds.
Returns
An R6
object with throttle configuration.
Examples
throttle <- crew_throttle(seconds_interval = 0.5) throttle$poll() throttle$poll()
Method validate()
Validate the object.
Usage
crew_class_throttle$validate()
Returns
NULL
(invisibly).
Method poll()
Poll the throttler.
Usage
crew_class_throttle$poll()
Returns
TRUE
if poll()
did not return TRUE
in the last
seconds_interval
seconds, FALSE
otherwise.
Method reset()
Reset the throttle object so the next poll()
returns
TRUE
.
Usage
crew_class_throttle$reset()
Returns
NULL
(invisibly).
See Also
Other throttle:
crew_throttle()
Examples
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()
[Package crew version 0.9.5 Index]