Deprecated alias to Boxed.
Deprecated alias to boxed.
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.
Constructor function to create a shared Boxed with an unqualified template type.
Exhausts the concurrency message mailbox.
Sleep in small periods, checking the passed abort bool in between to see if we should break and return.
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.
Embodies the notion of a request to output something to the local terminal.
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 stop std.concurrency.send from requiring so much compilation memory.
import std.concurrency; mainThread.send(ThreadMessage.sendline("Message to send to server")); mainThread.send(ThreadMessage.pong("irc.libera.chat")); mainThread.send(OutputRequest(ThreadMessage.TerminalOutput.writeln, "writeln this for me please")); mainThread.send(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 concurrency message passing, threads and Fibers.