Runs a process in the context of this runtime
(&mut self, future: Fut)
| 343 | /// Runs a process in the context of this runtime |
| 344 | /// |
| 345 | fn run_process<Fut: 'static+Future<Output=()>>(&mut self, future: Fut) { |
| 346 | // Box the future for polling |
| 347 | let future = future.boxed_local(); |
| 348 | |
| 349 | // Assign an ID to this future (we use this for waking it up) |
| 350 | let future_id = NEXT_FUTURE_ID.fetch_add(1, Ordering::Relaxed); |
| 351 | |
| 352 | // Store in the runtime |
| 353 | self.futures.insert(future_id, future); |
| 354 | |
| 355 | // Perform the initial polling operation on the future |
| 356 | self.poll_future(future_id); |
| 357 | } |
| 358 | |
| 359 | /// |
| 360 | /// Causes the future with the specified ID to be polled |
no test coverage detected