Lua API

    The server will function as a basic Server-Sent Events pub/sub server without using any of the Lua functionality like authorization, message routing, etc. However, advanced behaviors require writing Lua code to implement custom logic. The server is asynchronous and invokes global Lua functions defined in the script given by the --script=<path> option when various events occur. The server will provide arguments to the functions with context of the event.

    The program runs in a single Lua context for the lifetime of the server so that a global state is shared across the various function calls.