pub struct RuntimeManager { /* private fields */ }Implementations§
Source§impl RuntimeManager
impl RuntimeManager
Sourcepub fn block_in_place<R, F: FnOnce() -> R>(&self, f: F) -> R
pub fn block_in_place<R, F: FnOnce() -> R>(&self, f: F) -> R
Runs the given function on this thread while allowing another thread to take over this thread’s task execution duties.
Simply directly calls f() if this thread is not an async executor thread.
Sourcepub fn block_in_place_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
pub fn block_in_place_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
Blocks this thread to evaluate the given future.
This is more expensive than block_on when called from an async runtime worker thread because other async tasks scheduled to run on this thread have to be moved to a new thread.
If more than POLARS_MAX_BLOCKING_THREAD_COUNT calls to this occur simultaneously a deadlock may occur.
Sourcepub fn block_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
pub fn block_on<F>(&self, future: F) -> F::Outputwhere
F: Future,
Blocks this thread to evaluate the given future.
Panics if the current thread is an async runtime worker thread.
Sourcepub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
pub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
Spawns a future onto the Tokio runtime (see tokio::runtime::Runtime::spawn).
pub fn spawn_blocking<F, R>(&self, f: F) -> JoinHandle<R>
Auto Trait Implementations§
impl !Freeze for RuntimeManager
impl RefUnwindSafe for RuntimeManager
impl Send for RuntimeManager
impl Sync for RuntimeManager
impl Unpin for RuntimeManager
impl UnsafeUnpin for RuntimeManager
impl UnwindSafe for RuntimeManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more