https://github.com/sile/erl_rpc
Erlang RPC Client for Rust
https://github.com/sile/erl_rpc
erlang rust
Last synced: 20 days ago
JSON representation
Erlang RPC Client for Rust
- Host: GitHub
- URL: https://github.com/sile/erl_rpc
- Owner: sile
- License: apache-2.0
- Created: 2022-04-02T14:08:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T12:47:26.000Z (about 1 year ago)
- Last Synced: 2025-04-09T20:44:35.439Z (21 days ago)
- Topics: erlang, rust
- Language: Rust
- Homepage:
- Size: 28.3 KB
- Stars: 21
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
erl_rpc
=======[](https://crates.io/crates/erl_rpc)
[](https://docs.rs/erl_rpc)
[](https://github.com/sile/erl_rpc/actions)
[](https://coveralls.io/github/sile/erl_rpc?branch=main)
Erlang RPC Client for Rust.
Examples
--------```rust
smol::block_on(async {
// Connect to an Erlang node.
let erlang_node = "foo@localhost";
let cookie = "cookie-value";
let client = erl_rpc::RpcClient::connect(erlang_node, cookie).await?;
let mut handle = client.handle();// Run the RPC client as a background task.
smol::spawn(async {
if let Err(e) = client.run().await {
eprintln!("RpcClient Error: {}", e);
}
}).detach();// Execute an RPC: `erlang:processes/0`
let result = handle
.call("erlang".into(), "processes".into(), erl_dist::term::List::nil())
.await?;
println!("{}", result);
Ok(())
})
```