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
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
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