Timer

gears.async.Timer
class Timer(tickDuration: Duration) extends Cancellable

Timer exposes a steady Async.Source of ticks that happens every tickDuration milliseconds. Note that the timer does not start ticking until start is called (which is a blocking operation, until the timer is cancelled).

You might want to manually cancel the timer, so that it gets garbage collected (before the enclosing Async scope ends).

Attributes

Graph
Supertypes
trait Cancellable
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

enum TimerEvent

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

override def cancel(): Unit

Issue a cancel request

Issue a cancel request

Attributes

Definition Classes
def run()(using Async, AsyncOperations): Unit

Starts the timer. Suspends until the timer is cancelled.

Starts the timer. Suspends until the timer is cancelled.

Attributes

final inline def src: Source[TimerEvent]

Ticks of the timer are delivered through this source. Note that ticks are ephemeral.

Ticks of the timer are delivered through this source. Note that ticks are ephemeral.

Attributes

Inherited methods