Lines Matching full:executor
30 /// An executor for scheduling tasks that poll futures to completion.
32 /// All asynchronous operations must run within an executor, which is capable of spawning futures as
33 /// tasks. This executor also provides a mechanism for performing asynchronous I/O operations.
35 /// The returned type is a cheap, clonable handle to the underlying executor. Cloning it will only
36 /// create a new reference, not a new executor.
47 /// use cros_async::{AsyncResult, Executor, IoSourceExt, complete3};
88 /// let ex = Executor::new()?;
120 pub enum Executor { enum
125 impl Executor { impl
126 /// Create a new `Executor`.
129 Ok(URingExecutor::new().map(Executor::Uring)?) in new()
132 .map(Executor::Fd) in new()
133 .map_err(PollError::Executor)?) in new()
139 /// reference to the executor.
145 Executor::Uring(ex) => async_uring_from(f, ex), in async_from()
146 Executor::Fd(ex) => async_poll_from(f, ex), in async_from()
150 /// Spawn a new future for this executor to run to completion. Callers may use the returned
163 /// # use cros_async::Executor;
164 /// use futures::executor::block_on;
166 /// # let ex = Executor::new()?;
168 /// # // Spawn a thread that runs the executor.
187 Executor::Uring(ex) => ex.spawn(f), in spawn()
188 Executor::Fd(ex) => ex.spawn(f), in spawn()
192 /// Spawn a thread-local task for this executor to drive to completion. Like `spawn` but without
198 /// `Executor::run` and `Executor::run_util` will panic if they try to poll a future that was
206 /// # use cros_async::Executor;
208 /// # let ex = Executor::new()?;
225 Executor::Uring(ex) => ex.spawn_local(f), in spawn_local()
226 Executor::Fd(ex) => ex.spawn_local(f), in spawn_local()
230 /// Run the executor indefinitely, driving all spawned futures to completion. This method will
245 /// use cros_async::Executor;
246 /// use futures::executor::block_on;
248 /// let ex = Executor::new()?;
250 /// // Spawn a thread that runs the executor.
265 Executor::Uring(ex) => ex.run()?, in run()
266 Executor::Fd(ex) => ex.run().map_err(PollError::Executor)?, in run()
272 /// Drive all futures spawned in this executor until `f` completes. This method will block the
274 /// executor.
286 /// use cros_async::Executor;
288 /// let ex = Executor::new()?;
301 Executor::Uring(ex) => Ok(ex.run_until(f)?), in run_until()
302 Executor::Fd(ex) => Ok(ex.run_until(f).map_err(PollError::Executor)?), in run_until()