Documentation
¶
Overview ¶
Package lua exposes hex/events to Lua scripts as the "events" module.
local events = require("events")
events.emit("user.created", { id = 1, name = "alice" })
events.emit("app.ready") -- no payload
v1 is emit-only. Subscribing from Lua ("events.on(...)") is a follow-up: cross-goroutine callbacks into an LState need careful serialisation (the LState is not thread-safe), and the REPL / scripting use cases don't need it yet. Go-side subscribers registered via app.On see Lua-emitted events immediately.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeStub string
TypeStub is the Teal .d.tl source describing the `events` module.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.