Skip to content

Conversation

oblique
Copy link

@oblique oblique commented Jul 25, 2020

With this someone can run both Executor and LocalExecutor. Here's an example:

let ex = Executor::new();
let local_ex = LocalExecutor::new();

local_ex.enter(|| ex.run(async { }));

// or

ex.enter(|| local_ex.run(async { }));

LOCAL_EX.with(|local_ex| Rc::clone(&local_ex.parker))
} else {
Rc::new(parking::Parker::new())
};
Copy link
Author

@oblique oblique Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this acceptable?
Another way is refactoring multitask and introducing LocalTicker.

@Keruspe
Copy link
Contributor

Keruspe commented Jul 25, 2020

See also #3 for a much simpler (imo) alternative which works fine to do just that with each thread doing some ex.enter(|| local_ex.run(fut))

@ghost
Copy link

ghost commented Aug 29, 2020

Closing for the same reason as #6

@ghost ghost closed this Aug 29, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants