MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / poll_future

Method poll_future

draw/src/glutin_runtime.rs:362–377  ·  view source on GitHub ↗

Causes the future with the specified ID to be polled

(&mut self, future_id: u64)

Source from the content-addressed store, hash-verified

360 /// Causes the future with the specified ID to be polled
361 ///
362 fn poll_future(&mut self, future_id: u64) {
363 if let Some(future) = self.futures.get_mut(&future_id) {
364 // Create a context to poll this future in
365 let glutin_waker = GlutinFutureWaker { future_id: Mutex::new(Some(future_id)) };
366 let glutin_waker = task::waker(Arc::new(glutin_waker));
367 let mut glutin_context = task::Context::from_waker(&glutin_waker);
368
369 // Poll the future
370 let poll_result = future.poll_unpin(&mut glutin_context);
371
372 // Remove the future from the list if it has completed
373 if let task::Poll::Ready(_) = poll_result {
374 self.futures.remove(&future_id);
375 }
376 }
377 }
378}
379
380impl task::ArcWake for GlutinFutureWaker {

Callers 2

handle_thread_eventMethod · 0.80
run_processMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected