Prepare for release

This commit is contained in:
Tim
2018-10-16 21:59:59 -07:00
parent 905e5be8bb
commit 29067b7773
33 changed files with 249 additions and 96 deletions

View File

@@ -1,7 +1,8 @@
// Copyright 2018 Google Inc. All Rights Reserved.
// Copyright 2018 Google LLC
//
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
//! Tests client/server control flow.
@@ -29,7 +30,7 @@ use std::{
};
async fn bench() -> io::Result<()> {
let listener = bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let listener = tarpc_bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let addr = listener.local_addr();
tokio_executor::spawn(
@@ -42,7 +43,7 @@ async fn bench() -> io::Result<()> {
.compat()
);
let conn = await!(bincode_transport::connect(&addr))?;
let conn = await!(tarpc_bincode_transport::connect(&addr))?;
let client = &mut await!(Client::<u32, u32>::new(client::Config::default(), conn))?;
let total = 10_000usize;

View File

@@ -1,7 +1,8 @@
// Copyright 2018 Google Inc. All Rights Reserved.
// Copyright 2018 Google LLC
//
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
//! Tests client/server control flow.
@@ -37,7 +38,7 @@ impl AsDuration for SystemTime {
}
async fn run() -> io::Result<()> {
let listener = bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let listener = tarpc_bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let addr = listener.local_addr();
let server = Server::<String, String>::new(server::Config::default())
.incoming(listener)
@@ -78,14 +79,14 @@ async fn run() -> io::Result<()> {
tokio_executor::spawn(server.unit_error().boxed().compat());
let conn = await!(bincode_transport::connect(&addr))?;
let conn = await!(tarpc_bincode_transport::connect(&addr))?;
let client = await!(Client::<String, String>::new(
client::Config::default(),
conn
))?;
// Proxy service
let listener = bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let listener = tarpc_bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let addr = listener.local_addr();
let proxy_server = Server::<String, String>::new(server::Config::default())
.incoming(listener)
@@ -116,7 +117,7 @@ async fn run() -> io::Result<()> {
let client = await!(Client::<String, String>::new(
config,
await!(bincode_transport::connect(&addr))?
await!(tarpc_bincode_transport::connect(&addr))?
))?;
// Make 3 speculative requests, returning only the quickest.

View File

@@ -1,7 +1,8 @@
// Copyright 2018 Google Inc. All Rights Reserved.
// Copyright 2018 Google LLC
//
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
//! Tests client/server control flow.
@@ -36,7 +37,7 @@ impl AsDuration for SystemTime {
}
async fn run() -> io::Result<()> {
let listener = bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let listener = tarpc_bincode_transport::listen(&"0.0.0.0:0".parse().unwrap())?;
let addr = listener.local_addr();
let server = Server::<String, String>::new(server::Config::default())
.incoming(listener)
@@ -81,7 +82,7 @@ async fn run() -> io::Result<()> {
config.max_in_flight_requests = 10;
config.pending_request_buffer = 10;
let conn = await!(bincode_transport::connect(&addr))?;
let conn = await!(tarpc_bincode_transport::connect(&addr))?;
let client = await!(Client::<String, String>::new(config, conn))?;
let clients = (1..=100u32).map(|_| client.clone()).collect::<Vec<_>>();