tryUse
Tries to use the specified key with the given cooldownMillis.
If the key is ready, sets the cooldown and returns true. Otherwise, returns false.
Return
true if the key was ready and the cooldown was set, false otherwise
Parameters
key
the key to try to use
cooldownMillis
the duration of the cooldown in milliseconds to set if ready
onExpiry
optional callback to execute when the cooldown expires
Tries to use the specified key with the given cooldown.
If the key is ready, sets the cooldown and returns true. Otherwise, returns false.
Return
true if the key was ready and the cooldown was set, false otherwise
Parameters
key
the key to try to use
cooldown
the Duration of the cooldown to set if ready
onExpiry
optional callback to execute when the cooldown expires