changed the order of timeouts to prevent connection timeout to playpen
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user