A payload of type T wrapped in a class implementing the Sendable interface. Used to box values for sending via the message bus.
A Fiber carrying a payload of type T, along with some metadata.
Constructor function to create a shared Boxed with an unqualified template type.
Convenience function creating a new CarryingFiber while inferring the payload type T from the passed payload argument.
Iterates the messages and priorityMessages arrays of each plugin. If a quit message is found, its content is returned.
Sleep in small periods, checking the passed abort flag in between to see if we should break and return.
Prototype to allow linking to pthread's function for naming threads.
Sets the thread name of the current thread, so they will show up named in process managers (like top).
Interface for a message sendable through the message bus.
A delegate paired with a long UNIX timestamp.
A Fiber paired with a long UNIX timestamp.
Collection of static functions used to construct thread messages, for passing information of different kinds yet still as one type, to be able to store them in arrays for later processing.
plugin.state.messages ~= ThreadMessage.sendline("Message to send to server"); plugin.state.priorityMessages ~= ThreadMessage.pong("irc.libera.chat"); plugin.state.messages ~= ThreadMessage.askToWriteln("writeln this for me please"); plugin.state.messages ~= ThreadMessage.busMessage("header", boxed("payload")); auto fiber = new CarryingFiber!string(&someDelegate, BufferSize.fiberStack); fiber.payload = "This string is carried by the fiber and can be accessed from within it"; fiber.call(); fiber.payload = "You can change it in between calls to pass information to it"; fiber.call(); // As such we can make fibers act like they're taking new arguments each call auto fiber2 = new CarryingFiber!IRCEvent(&otherDelegate, BufferSize.fiberStack); fiber2.payload = newIncomingIRCEvent; fiber2.call(); // [...] fiber2.payload = evenNewerIncomingIRCEvent; fiber2.call();
Structures and functions related to message passing, threads and Fibers.