crew_class_throttle | R Documentation |
R6
throttle class.R6
class for throttle configuration.
See crew_throttle()
.
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()
returned TRUE
.
NULL
if poll()
was never called on the current object.
new()
Throttle constructor.
crew_class_throttle$new( seconds_max = NULL, seconds_min = NULL, seconds_start = NULL, base = NULL )
seconds_max
See crew_throttle()
.
seconds_min
See crew_throttle()
.
seconds_start
See crew_throttle()
.
base
See crew_throttle()
.
An R6
object with throttle configuration.
throttle <- crew_throttle(seconds_max = 1) 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
max
seconds, FALSE
otherwise.
accelerate()
Divide seconds_interval
by base
.
crew_class_throttle$accelerate()
NULL
(invisibly). Called for its side effects.
decelerate()
Multiply seconds_interval
by base
.
crew_class_throttle$decelerate()
NULL
(invisibly). Called for its side effects.
reset()
Reset the throttle object so the next poll()
returns
TRUE
, and reset the wait time interval to its initial value.
crew_class_throttle$reset()
NULL
(invisibly).
update()
Reset the throttle when there is activity and decelerate it gradually when there is no activity.
crew_class_throttle$update(activity)
activity
TRUE
if there is activity, FALSE
otherwise.
NULL
(invisibly).
Other throttle:
crew_throttle()
throttle <- crew_throttle(seconds_max = 1)
throttle$poll()
throttle$poll()
## ------------------------------------------------
## Method `crew_class_throttle$new`
## ------------------------------------------------
throttle <- crew_throttle(seconds_max = 1)
throttle$poll()
throttle$poll()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.