rt: add Handle::spawn_blocking method (#2501)

This follows a similar pattern to `Handle::spawn` to add the
blocking spawn capabilities to `Handle`.
This commit is contained in:
Adam C. Foltzer
2020-05-07 16:24:24 -07:00
committed by GitHub
parent 4748b2571f
commit 07533a5255
5 changed files with 83 additions and 5 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ impl fmt::Debug for BlockingPool {
// ===== impl Spawner =====
impl Spawner {
fn spawn(&self, task: Task, rt: &Handle) -> Result<(), ()> {
pub(crate) fn spawn(&self, task: Task, rt: &Handle) -> Result<(), ()> {
let shutdown_tx = {
let mut shared = self.inner.shared.lock().unwrap();