Introduced dylib extension format, cleared up shutdown sequence

This commit is contained in:
2026-01-17 00:23:35 +01:00
parent 1a7230ce9b
commit 6a3c1d5917
18 changed files with 214 additions and 113 deletions

View File

@@ -6,7 +6,6 @@ use std::rc::Rc;
use std::{io, mem};
use futures::future::{LocalBoxFuture, join_all};
use futures::lock::Mutex;
use futures::{AsyncRead, AsyncWrite, AsyncWriteExt, StreamExt, stream};
use hashbrown::HashMap;
use itertools::Itertools;
@@ -50,7 +49,7 @@ task_local::task_local! {
fn get_client() -> Rc<dyn Client> { CLIENT.get() }
pub async fn exit() {
let cx = CTX.get().borrow_mut().take();
cx.unwrap().exit().await
cx.unwrap().exit().await.unwrap()
}
/// Sent the client used for global [request] and [notify] functions within the
@@ -139,8 +138,7 @@ impl ExtensionBuilder {
ctx.output.as_mut().flush().await.unwrap();
let logger1 = LoggerImpl::from_api(&host_header.logger);
let logger2 = logger1.clone();
let (client, comm_ctx, extension_srv) =
io_comm(Rc::new(Mutex::new(ctx.output)), Mutex::new(ctx.input));
let (client, comm_ctx, extension_srv) = io_comm(ctx.output, ctx.input);
let extension_fut = extension_srv.listen(
async |n: Box<dyn MsgReader<'_>>| {
let notif = n.read().await.unwrap();