shakespeare/actors/periodic

An actor that runs periodically.

Types

An interval of time.

pub type Interval {
  Ms(Int)
}

Constructors

  • Ms(Int)

    An interval in milliseconds.

An actor that performs a given action periodically.

pub opaque type PeriodicActor

Functions

pub fn start(
  do do_work: fn() -> Nil,
  every interval: Interval,
) -> Result(PeriodicActor, StartError)

Starts a new PeriodicActor that executes the given function on the specified interval.

Search Document