set
Sets the cooldown for the specified key in milliseconds.
Parameters
key
the key to set the cooldown for
cooldownMillis
the duration of the cooldown in milliseconds. Must be non-negative.
onExpiry
optional callback to execute when the cooldown expires
Throws
if cooldownMillis is negative
Sets the cooldown for the specified key using a Duration.
Parameters
key
the key to set the cooldown for
cooldown
the Duration of the cooldown
onExpiry
optional callback to execute when the cooldown expires