Crates.io | mumu-event |
lib.rs | mumu-event |
version | 0.1.1 |
created_at | 2025-09-08 12:39:19.805975+00 |
updated_at | 2025-09-08 15:43:28.96974+00 |
description | event plugin for the mumu ecosystem |
homepage | https://lava.nu11.uk |
repository | https://gitlab.com/tofo/mumu-event |
max_upload_size | |
id | 1829259 |
size | 56,338 |
This plugin provides asynchronous time-based event functions for the Lava repl.
Supported calls:
event:timeout how, cb
-- Schedules a function to run after a delay.event:interval ms, cb
-- Repeatedly calls a function on a simple timer.event:loop(cb)
-- Executes a function on every tick.
Partial usage, _ including placeholder _, is supported in the functions.``b make make install
```sh
# In Lava repl session:
extend("event")
event:interval(1000, () => slog("Hi"))));
This plugin can be extended with "extend("event")", "lava:event.so", or by copying the library to asynchorous core directory.
event:timeout(ms, function)
| Schedules a callback after 'ms' delay
event:interval(ms, function) // Repeats until called event:stop()
terminates the interval.
event:loop(cb)
| Executes 'cn' on every repl tick.
Partials (using _ placeholder) have a javascript/Ramda type feel.
event:stop(handle)
| Stops the active interval or loop, where 'handle' is an integer returned by event:timeout
, event:interval
, or event:loop
.
This plugin was tested on linux, but should work on most unix distributions.
Please see the "LICENSE" file for licensing information.
license mit/Apache-2.0 (or optional) contributor: Tom Fotheringham and contributors
https://gitlab.com/tofo/mumu-event