Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract and export a standalone TaskRunner #690

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Jan 5, 2018

This commit extracts the TaskRunner interface from the current_thread module
to a standalone interface and also reexports it from the executor module. This
is done with #675 as the primary motivation, namely accommodating crates using
CurrentThread on foreign event loops like glib. In this situation Rust (and
associated code) can't request to block (aka with run_with_sleep) and as a
result need a nonblocking method (TaskRunner::poll here) instead.

The current_thread module was then reimplemented in terms of TaskRunner to
ensure there's no extra duplication.

Closes #675

This commit extracts the `TaskRunner` interface from the `current_thread` module
to a standalone interface and also reexports it from the `executor` module. This
is done with #675 as the primary motivation, namely accommodating crates using
`CurrentThread` on foreign event loops like glib. In this situation Rust (and
associated code) can't request to block (aka with `run_with_sleep`) and as a
result need a nonblocking method (`TaskRunner::poll` here) instead.

The `current_thread` module was then reimplemented in terms of `TaskRunner` to
ensure there's no extra duplication.
@alexcrichton
Copy link
Member Author

Work is happening on the 0.2 branch now, so closing this.

@alexcrichton alexcrichton deleted the task-runner branch February 9, 2018 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant