overall cleanup, more tests, fixing clashes, removing unwraps, hardening against protocol errors, prepare prio mgr to take commands from scheduler

fix async_recv and double block_on panic on Network::drop and participant::drop
include Cargo.lock from all examples
Found a bug on imbris runners with doc tests of `stream::send` and `stream::recv`
As neither a backtrace, nor tracing on runners in the doc tests seems to help, i disable them and add them as unit tests
This commit is contained in:
Marcel Märtens
2020-05-27 17:58:57 +02:00
parent a86cfbae65
commit 2a7c5807ff
28 changed files with 2932 additions and 1207 deletions

View File

@ -704,20 +704,6 @@ name = "serde"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_json"
@ -919,7 +905,6 @@ version = "0.1.0"
dependencies = [
"async-std",
"bincode",
"byteorder",
"futures",
"lazy_static",
"prometheus",

View File

@ -1,3 +1,8 @@
//!run with
//! ```bash
//! (cd network/examples/chat && RUST_BACKTRACE=1 cargo run --release -- --trace=info --port 15006)
//! (cd network/examples/chat && RUST_BACKTRACE=1 cargo run --release -- --trace=info --port 15006 --mode=client)
//! ```
use async_std::io;
use clap::{App, Arg};
use futures::executor::{block_on, ThreadPool};
@ -96,7 +101,7 @@ fn main() {
fn server(address: Address) {
let thread_pool = ThreadPoolBuilder::new().build();
let server = Arc::new(Network::new(Pid::new(), &thread_pool));
let server = Arc::new(Network::new(Pid::new(), &thread_pool, None));
let pool = ThreadPool::new().unwrap();
block_on(async {
server.listen(address).await.unwrap();
@ -135,7 +140,7 @@ async fn client_connection(network: Arc<Network>, participant: Arc<Participant>)
fn client(address: Address) {
let thread_pool = ThreadPoolBuilder::new().build();
let client = Network::new(Pid::new(), &thread_pool);
let client = Network::new(Pid::new(), &thread_pool, None);
let pool = ThreadPool::new().unwrap();
block_on(async {