https://github.com/bondy-io/bondy_net
An Erlang/OTP Library that implements unified proxy distribution module providing a common interface between disterl, partisan and any alternative distribution layer.
https://github.com/bondy-io/bondy_net
bondy erlang partisan
Last synced: about 1 year ago
JSON representation
An Erlang/OTP Library that implements unified proxy distribution module providing a common interface between disterl, partisan and any alternative distribution layer.
- Host: GitHub
- URL: https://github.com/bondy-io/bondy_net
- Owner: bondy-io
- License: apache-2.0
- Created: 2025-04-03T10:41:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-03T19:36:26.000Z (about 1 year ago)
- Last Synced: 2025-04-09T18:15:54.390Z (about 1 year ago)
- Topics: bondy, erlang, partisan
- Language: Erlang
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# bondy_net
`bondy_net` is a backend-agnostic Erlang application that provides a unified interface over either **Distributed Erlang**, **[Partisan](https://partisan.dev)** or other disterl alternatives.
It allows your application to switch distribution backends **without modifying application code**.
Notice `bondy_net` doesn't use [Bondy](bondy.io) (the application networking platform). It is called `bondy_net` as it is part of the Bondy suite of libraries.
## Why Use `bondy_net`?
* Switch between distribution backends without rewriting your code
* Keep application logic decoupled from distribution mechanics
## Features
* Unified API for sending messages, monitor nodes and obtaining information
* Supports both **Distributed Erlang** and **Partisan**
* Backend selection via environment variable or application config
* Uses parse transforms for **zero-runtime dispatch cost**
## Installation
Add to your `rebar.config` dependencies:
{deps, [
bondy_net
]}.
Make sure you also:
* include `bondy_net` as an application in your `app.src` file. At startup the application will generate the `bondy_net` module using parse transforms based on your configuration
* include `partisan` or your custom backend if you’re are not using disterl.
## Configuration
Set the backend distribution system via `sys.config`:
```erlang
{bondy_net, [
{backend, partisan}
]}.
```
## Usage
Use `bondy_net` module just like you’d use `erlang` (`net_kernel`) and `partisan`.
Check the implemented functions in `bondy_net` as only a subset of functions is implemented.
## Broadcasting
Since there is no implementation for broadcasting natively in Erlang a call to
`bondy_net:broadcast/2` will fail unless you also provide a `broadcast_backend` module that implements the callback e.g. `my_module` in the following example.
```erlang
{bondy_net, [
{backend, erlang},
{broadcast_backend, my_module}
]}.
```