Erlang and Elixir make it very easy to send messages between processes even across the network, but there are a few pitfalls. Sending a message to many PIDs across the network also copies the message across the network many times. Send calls cost about 70 µs/op so doing them in a loop eventually gets too expensive. Manifold distributes the work of sending messages to the remote nodes of the PIDs, which guarantees that the sending processes at most only calls send/2 equal to the number of involved remote nodes. Manifold does this by first grouping PIDs by their remote node and then sending to Manifold.Partitioner on each of those nodes. The partitioner then consistently hashes the PIDs using :erlang.phash2/2, groups them by the number of cores, sends to child workers, and finally those workers send to the actual PIDs. This ensures the partitioner does not get overloaded and still provides the linearizability guaranteed by send/2.

Features

  • Manifold takes a single configuration option, which sets the module it dispatches to actually call send
  • The default is GenServer
  • Manifold is released under the MIT License
  • Do not mix calls to Manifold with and without offloading
  • Add it to mix.exs
  • Customize configuration

Project Samples

Project Activity

See All Activity >

Categories

Communications

License

MIT License

Follow Manifold

Manifold Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Manifold!

Additional Project Details

Programming Language

Elixir

Related Categories

Elixir Communications Software

Registered

2022-10-07