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

Other Useful Business Software
Auth0 for AI Agents now in GA Icon
Auth0 for AI Agents now in GA

Ready to implement AI with confidence (without sacrificing security)?

Connect your AI agents to apps and data more securely, give users control over the actions AI agents can perform and the data they can access, and enable human confirmation for critical agent actions.
Start building today
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