Documentation
¶
Overview ¶
Package lua exposes hex/queue to Lua scripts as the "queue" module.
local queue = require("queue")
local id, err = queue.publish("send_email", '{"to":"a@b.c"}')
v1 is publish-only. Subscribing from Lua ("queue.subscribe(topic, function(msg) ... end)") is a follow-up: bridging a long-running Go goroutine to a Lua callback needs LState serialisation (LStates are not thread-safe), which the REPL and scripting use cases don't need yet. Go-side subscribers see Lua-published messages immediately.
Message bodies are strings on the Lua side; hex/queue stores raw []byte. Structured payloads should be JSON-encoded before publish — a gopher-json module is on the follow-up list.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeStub string
TypeStub is the Teal .d.tl source describing the `queue` module.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.