mirror of
https://github.com/OMGeeky/tarpc.git
synced 2025-12-29 15:49:52 +01:00
Remove await!() macro from readme
This commit is contained in:
@@ -48,7 +48,7 @@ races!
|
||||
Here's a small service.
|
||||
|
||||
```rust
|
||||
#![feature(arbitrary_self_types, await_macro, async_await, proc_macro_hygiene)]
|
||||
#![feature(arbitrary_self_types, async_await, proc_macro_hygiene)]
|
||||
|
||||
|
||||
use futures::{
|
||||
@@ -103,17 +103,17 @@ async fn run() -> io::Result<()> {
|
||||
|
||||
tokio_executor::spawn(server.unit_error().boxed().compat());
|
||||
|
||||
let transport = await!(bincode_transport::connect(&addr))?;
|
||||
let transport = bincode_transport::connect(&addr).await?;
|
||||
|
||||
// new_stub is generated by the service! macro. Like Server, it takes a config and any
|
||||
// Transport as input, and returns a Client, also generated by the macro.
|
||||
// by the service mcro.
|
||||
let mut client = await!(new_stub(client::Config::default(), transport))?;
|
||||
let mut client = new_stub(client::Config::default(), transport).await?;
|
||||
|
||||
// The client has an RPC method for each RPC defined in service!. It takes the same args
|
||||
// as defined, with the addition of a Context, which is always the first arg. The Context
|
||||
// specifies a deadline and trace information which can be helpful in debugging requests.
|
||||
let hello = await!(client.hello(context::current(), "Stim".to_string()))?;
|
||||
let hello = client.hello(context::current(), "Stim".to_string()).await?;
|
||||
|
||||
println!("{}", hello);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user