fix(napi): future in block_on do not need to be send
This commit is contained in:
parent
3cbae4e8c1
commit
e332270698
1 changed files with 1 additions and 4 deletions
|
@ -65,10 +65,7 @@ where
|
||||||
/// Runs a future to completion
|
/// Runs a future to completion
|
||||||
/// This is blocking, meaning that it pauses other execution until the future is complete,
|
/// This is blocking, meaning that it pauses other execution until the future is complete,
|
||||||
/// only use it when it is absolutely necessary, in other places use async functions instead.
|
/// only use it when it is absolutely necessary, in other places use async functions instead.
|
||||||
pub fn block_on<F, O>(fut: F) -> F::Output
|
pub fn block_on<F: Future>(fut: F) -> F::Output {
|
||||||
where
|
|
||||||
F: 'static + Send + Future<Output = O>,
|
|
||||||
{
|
|
||||||
RT.read().unwrap().as_ref().unwrap().block_on(fut)
|
RT.read().unwrap().as_ref().unwrap().block_on(fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue