← Application timers

Timer.StartOptions

luastra/timer

Timer.StartOptions is the checked configuration record accepted by the related SDK operation. Required fields establish the minimum contract, while optional fields preserve documented defaults when omitted.

Before you use it

Add luastra/timer to this module's dependencies in luastra.json, then import it with require("luastra/timer"). Declare timer.control in luastra.json and implement app.handle for timer events. The maximum delay is 60,000 ms.

How it fits

Timer types describe the options or acknowledgement identifier.

When to use it

Use Timer.StartOptions when a reusable variable or helper passes configuration to the related SDK operation. The exported type keeps optional and required fields aligned with the checked public contract.

Fields or definition

ParameterType / valuesDescription
idstringStable logical timer ID later delivered as the timer event target.
delayMsnumberNon-negative one-shot delay before app.handle receives the event.
valuestring?Optional bounded value delivered with the timer event.

What happens next

A checked timer option or acknowledgement annotation.

Failures and fixes

Missing timer.control, an invalid lowercase timer id, a delay outside 0..60000, or an oversized value fails before a timer event is scheduled. Treat late events as stale if the owning state has already changed.

Availability

Public-source alpha API in 0.5.0-alpha; exact background timing remains host-dependent.

Exact declaration

export type StartOptions = {
    id: string,
    delayMs: number,
    value: string?,
}

Continue learning

Companions

Timer.cancel

Next steps

Timer.restart

Complete inventory

View all pages in Application timers
← Previous: Timer.RequestIdNext: Timer.start →