Timer

final case class Timer[A](action: IO[A], delay: FiniteDuration) extends LazyLogging

Utility class capable of delaying the execution of an IO action for a certain duration

This timer can be reset or canceled at any moment

Type parameters:
A

Return type of the scheduled action

Value parameters:
action

Action to be executed when timer delay is over

delay

Wait before executing the action

trait Serializable
trait Product
trait Equals
trait LazyLogging
class Object
trait Matchable
class Any

Value members

Concrete methods

def cancel(): IO[Unit]

Cancel this timer's countdown, preventing its action from executing

Cancel this timer's countdown, preventing its action from executing

def schedule(): IO[Unit]

Start the countdown on this timer, or reset it in case it's already running

Start the countdown on this timer, or reset it in case it's already running

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product

Inherited fields

@transient
lazy protected val logger: Logger
Inherited from:
LazyLogging