forked from Orchid/orchid
Fixed a hang when the cleanup code for an extension is too slow
This commit is contained in:
@@ -18,7 +18,7 @@ use memo_map::MemoMap;
|
||||
use never::Never;
|
||||
use orchid_api_traits::{Decode, Encode, enc_vec};
|
||||
use orchid_base::error::OrcRes;
|
||||
use orchid_base::format::{FmtCtx, FmtCtxImpl, FmtUnit, take_first};
|
||||
use orchid_base::format::{FmtCtx, FmtCtxImpl, FmtUnit, Format, take_first};
|
||||
use orchid_base::logging::log;
|
||||
use orchid_base::name::Sym;
|
||||
use task_local::task_local;
|
||||
@@ -93,10 +93,28 @@ impl<T: OwnedAtom> AtomDynfo for OwnedAtomDynfo<T> {
|
||||
})
|
||||
}
|
||||
fn call(&self, AtomCtx(_, id): AtomCtx, arg: Expr) -> LocalBoxFuture<'_, GExpr> {
|
||||
Box::pin(async move { take_atom(id.unwrap()).await.dyn_call(arg).await })
|
||||
Box::pin(async move {
|
||||
writeln!(
|
||||
log("msg"),
|
||||
"owned call {} {}",
|
||||
take_first(&AtomReadGuard::new(id.unwrap()).await.dyn_print().await, false),
|
||||
take_first(&arg.print(&FmtCtxImpl::default()).await, true),
|
||||
)
|
||||
.await;
|
||||
take_atom(id.unwrap()).await.dyn_call(arg).await
|
||||
})
|
||||
}
|
||||
fn call_ref<'a>(&'a self, AtomCtx(_, id): AtomCtx<'a>, arg: Expr) -> LocalBoxFuture<'a, GExpr> {
|
||||
Box::pin(async move { AtomReadGuard::new(id.unwrap()).await.dyn_call_ref(arg).await })
|
||||
Box::pin(async move {
|
||||
writeln!(
|
||||
log("msg"),
|
||||
"owned call_ref {} {}",
|
||||
take_first(&AtomReadGuard::new(id.unwrap()).await.dyn_print().await, false),
|
||||
take_first(&arg.print(&FmtCtxImpl::default()).await, true),
|
||||
)
|
||||
.await;
|
||||
AtomReadGuard::new(id.unwrap()).await.dyn_call_ref(arg).await
|
||||
})
|
||||
}
|
||||
fn print(&self, AtomCtx(_, id): AtomCtx<'_>) -> LocalBoxFuture<'_, FmtUnit> {
|
||||
Box::pin(async move { AtomReadGuard::new(id.unwrap()).await.dyn_print().await })
|
||||
|
||||
Reference in New Issue
Block a user