changed the order of timeouts to prevent connection timeout to playpen

This commit is contained in:
Carl Fredrik Samson
2020-02-01 19:22:32 +01:00
parent fe8762d9c9
commit 48e7150276
2 changed files with 4 additions and 4 deletions

View File

@@ -416,8 +416,8 @@ fn main() {
// - first parameter is the `reactor` // - first parameter is the `reactor`
// - the second is a timeout in seconds // - the second is a timeout in seconds
// - the third is an `id` to identify the task // - the third is an `id` to identify the task
let future1 = Task::new(reactor.clone(), 2, 1); let future1 = Task::new(reactor.clone(), 1, 1);
let future2 = Task::new(reactor.clone(), 1, 2); let future2 = Task::new(reactor.clone(), 2, 2);
// an `async` block works the same way as an `async fn` in that it compiles // an `async` block works the same way as an `async fn` in that it compiles
// our code into a state machine, `yielding` at every `await` point. // our code into a state machine, `yielding` at every `await` point.

View File

@@ -18,8 +18,8 @@ fn main() {
let reactor = Reactor::new(); let reactor = Reactor::new();
let reactor = Arc::new(Mutex::new(reactor)); let reactor = Arc::new(Mutex::new(reactor));
let future1 = Task::new(reactor.clone(), 2, 1); let future1 = Task::new(reactor.clone(), 1, 1);
let future2 = Task::new(reactor.clone(), 1, 2); let future2 = Task::new(reactor.clone(), 2, 2);
let fut1 = async { let fut1 = async {
let val = future1.await; let val = future1.await;