erl_rpc

Crates.ioerl_rpc
lib.rserl_rpc
version0.3.2
sourcesrc
created_at2022-04-03 01:43:10.261844
updated_at2024-02-12 13:07:27.735157
descriptionErlang RPC Client
homepagehttps://github.com/sile/erl_rpc
repositoryhttps://github.com/sile/erl_rpc
max_upload_size
id561120
size63,376
Takeru Ohta (sile)

documentation

README

erl_rpc

erl_rpc Documentation Actions Status Coverage Status License

Erlang RPC Client for Rust.

Examples

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(())
})
Commit count: 23

cargo fmt