chore: removed blocking_recv

just block_on(recv()) ...
This commit is contained in:
əlemi 2024-02-09 01:03:38 +01:00
parent e0d4360d09
commit f706237828

View file

@ -58,11 +58,4 @@ pub trait Controller<T : Sized + Send + Sync> : Sized + Send + Sync {
/// attempt to receive a value without blocking, return None if nothing is available /// attempt to receive a value without blocking, return None if nothing is available
fn try_recv(&self) -> Result<Option<T>>; fn try_recv(&self) -> Result<Option<T>>;
/// sync variant of [Self::recv], blocking invoking thread
/// this calls [Controller::recv] inside a [tokio::runtime::Runtime::block_on]
#[cfg(feature = "sync")]
fn blocking_recv(&self, rt: &tokio::runtime::Handle) -> Result<T> {
rt.block_on(self.recv())
}
} }