Per @ash:
You don’t need HTTP. You don’t even need delivery guarantees. If the whole thing is jammed into the same machine you could even use Unix sockets and pass raw data around, no serialization, no nothing.
Indeed. However, computer performance isn’t always the most important metric. In an experimental, exploratory project such as TBP, using convenient (if inefficient) approaches may improve the project velocity and even the results obtained. So, let’s look at some Elixir-flavored possibilities in terms of message handling, process dispatching, etc.
Elixir Basics
Elixir runs under the control of the Erlang virtual machine (aka the BEAM). Developed a few decades ago to support digital telephone switches, the BEAM is now used for a variety of use cases, including Internet of Things (IoT) networks, large-scale web servers, etc.
It supports distributed, fault tolerant, soft real-time behavior, using light-weight processes, preemptive multi-tasking, and a number of other mechanisms. Although most new and/or current BEAM-based systems are written in Elixir, Erlang is still used for about half (!) of the world’s telephone switch code.
Any BEAM process can send a message to any other, in raw “machine” form (i.e., as a data structure), as long as it has an ID for the target. This works no matter where the target is located; the BEAM takes care of “minor” details like addressing (i.e., which processor and process are involved) and transport.
However, there is no guarantee that messages will arrive, let alone in any particular order. So, it’s a bit like User Datagram Protocol (UDP), as opposed to Transmission Control Protocol (TCP) or Hypertext Transfer Protocol (HTTP, a TCP variant).
Also, the target process is required to tell the BEAM (via a sequence of input patterns) which message types to deliver, in what order. Worse, unmatched message types can fill up the BEAM’s heap and cause the entire node (OS process) to crash. So, Best Practice is to end the sequence with a universal (accept everything!) pattern.
Phoenix Speculation, redux
As I’ve mentioned before (to vanishingly little applause :-), I think it would be both possible and worthwhile to build a “lab bench” for Monty, based on Elixir, the Phoenix web framework et al, and a selected set of “web programming” standards, e.g.:
Although this would obviously add significant overhead, it would allow Monty developers and researchers to use the (very cushy and rapidly expanding) programming environment that Phoenix and its friends provide.
I hope to put together a first cut at such a lab bench at some point, but no promises. However, in any event I want Monty’s design to avoid precluding this sort of thing…