zephyr.timers

Schedule deferred messages back to the current module. Timers are in-memory and do not survive process restarts. Requires the `timers` permission.

1 function

after

timers
zephyr.timers.after(seconds, topic, payload)

After a delay, deliver a bus message to this module.

Parameters

secondsnumber

Delay in seconds before delivery.

topicstring

Bus topic to deliver on (subscribe with zephyr.bus.on).

payloadany

JSON-like payload value.

Returns

nil

Nothing.

Raises an error if

  • the timers permission is not granted

Example

lua
zephyr.timers.after(60, "finish", { id = "abc" })