- Notifications
You must be signed in to change notification settings - Fork3
Event-driven JSON-RPC client with support for multiple transports
License
NotificationsYou must be signed in to change notification settings
witnet/async-jsonrpc-client
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Event-driven JSON-RPC client.
This is a fork of the JSON-RPC client implementation fromweb3.
Supported transports:
- HTTP
- WebSockets
- TCP
First, add the dependency inCargo.toml.The required transports must be explicitely enabled as features:
async-jsonrpc-client = { version = "0.1.0", features = "ws" }The available features are:
["http", "tcp", "ws", "tls"]Where"tls" enables support forhttps andwss.
A WebSockets client which sends a request and waits for the response:
use serde_json::json;use async_jsonrpc_client::futures::Future;use async_jsonrpc_client::transports::ws::WebSocket;use async_jsonrpc_client::Transport;fnmain(){// Start server (starts tokio reactor in current thread)let(_handle, ws) =WebSocket::new("ws://127.0.0.1:3030").unwrap();// Send requestlet res = ws.execute("say_hello",json!({"name":"Tomasz"}));// Wait for responselet x = res.wait();println!("{:?}", x);}
About
Event-driven JSON-RPC client with support for multiple transports
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published