Spawn a `Task` on the `Reactor`.
(&self, fut: F)
| 286 | |
| 287 | /// Spawn a `Task` on the `Reactor`. |
| 288 | pub fn spawn<F, T>(&self, fut: F) -> Task<T> |
| 289 | where |
| 290 | F: Future<Output = T> + 'static, |
| 291 | T: 'static, |
| 292 | { |
| 293 | // Safety: 'static constraints satisfy the lifetime requirements |
| 294 | #[allow(unsafe_code)] |
| 295 | unsafe { |
| 296 | self.spawn_unchecked(fut) |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | pub(super) fn pop_ready_list(&self) -> Option<Runnable> { |
| 301 | self.inner.ready_list.lock().unwrap().pop_front() |