EMILUA(3em)

πŸ“¦ version 0.12.1, in nixos 26.05, nixpkgs unstable

πŸ’– EMILUA(3em) πŸ’–

okay bestie, welcome to the EMILUA(3em) page β€” the Emilua reference. It’s literally the Lua execution engine manual and we’re gonna make it make sense. ✨


✨ NAME ✨

Emilua β€” Lua execution engine.


🌈 DESCRIPTION 🌈

This class is all about waiting for one or more signals to occur. Like, it’s giving signal-bouncer energy, but make it Lua. πŸ’…

local set = system.signal.set.new(system.signal.SIGTERM, system.signal.SIGINT)
set:wait()
### ⚠️ Note: Multiple registration of signals so the Boost.Asio docs at https://www.boost.org/doc/libs/1_66_0/doc/html/boost_asio/reference/signal_set.html#boost_asio.reference.signal_set.multiple_registration_of_signals say this, translated to fibers/emilua lingo: The same signal number may be registered with different set objects. When the signal occurs, one signal notification is queued for each set object.

πŸ’… FUNCTIONS πŸ’…

🌸 new([sig1: integer, ...]) β†’ system.signal.set

Constructor. The arguments are treated as signals to be added to the set. No cap.

Note: only the main VM on the process may create new set objects. If the VM elects another VM to be the new main VM, its old set objects will remain valid and working, but the VM won’t be able to create new set objects. iykyk.

🧚 add(self, signal: integer)

Add a signal to the set.

Note: only the master VM is allowed to use this function. periodt.

πŸ¦‹ remove(self, signal: integer)

Remove a signal from the set.


πŸŽ€ clear(self)

Remove all signals from the set.


⭐ cancel(self)

Cancel all operations associated with the set.


πŸ‘‘ wait(self) β†’ integer

Wait for a signal to be delivered. The function will return when:

  • One of the registered signals in the set occurs; or
  • The set was cancelled, in which case the function will raise the exception boost::asio::error::operation_aborted.

A number is returned to indicate which signal occurred. iconic.

### πŸ’€ Note: Queueing of signal notifications As the Boost.Asio docs at https://www.boost.org/doc/libs/1_66_0/doc/html/boost_asio/reference/signal_set.html#boost_asio.reference.signal_set.queueing_of_signal_notifications say (translated to fibers/emilua lingo): If a signal is registered with a set, and the signal occurs when there are no calls to wait(), then the signal notification is queued. The next call to wait() on that set will dequeue the notification. If multiple notifications are queued, subsequent wait() calls dequeue them one at a time. Signal notifications are dequeued in order of ascending signal number. If a signal number is removed from a set (using the remove() member function) then any queued notifications for that signal are discarded.

okay that’s the whole page, bestie. mwah πŸ’‹ β€” from Emilua 0.12.1-nixpkgs1, dated 1980-01-01, and yes it’s the EMILUA(3em) manual. slay. 🫢

πŸ“¦ where this page comes from