Unit tests pass

Fixed a nasty deadlock in reqnot
This commit is contained in:
2026-01-19 00:56:03 +01:00
parent 6a3c1d5917
commit 48942b3b2c
15 changed files with 223 additions and 85 deletions

View File

@@ -34,6 +34,10 @@ pub fn orchid_extension_main_body(cx: ExtCx, builder: ExtensionBuilder) {
/// # Usage
///
/// ```
/// #[macro_use]
/// use orchid_extension::dylib_main;
/// use orchid_extension::entrypoint::ExtensionBuilder;
///
/// dylib_main! {
/// ExtensionBuilder::new("orchid-std::main")
/// }

View File

@@ -9,7 +9,6 @@ use futures::future::{LocalBoxFuture, join_all};
use futures::{AsyncRead, AsyncWrite, AsyncWriteExt, StreamExt, stream};
use hashbrown::HashMap;
use itertools::Itertools;
use orchid_api::{ExtHostNotif, ExtHostReq};
use orchid_api_traits::{Decode, Encode, Request, UnderRoot, enc_vec};
use orchid_base::char_filter::{char_filter_match, char_filter_union, mk_char_filter};
use orchid_base::error::try_with_reporter;
@@ -63,7 +62,7 @@ task_local! {
}
/// Send a request through the global client's [ClientExt::request]
pub async fn request<T: Request + UnderRoot<Root = ExtHostReq>>(t: T) -> T::Response {
pub async fn request<T: Request + UnderRoot<Root = api::ExtHostReq>>(t: T) -> T::Response {
let response = get_client().request(t).await.unwrap();
if MUTE_REPLY.try_with(|b| *b).is_err() {
writeln!(log("msg"), "Got response {response:?}").await;
@@ -72,7 +71,7 @@ pub async fn request<T: Request + UnderRoot<Root = ExtHostReq>>(t: T) -> T::Resp
}
/// Send a notification through the global client's [ClientExt::notify]
pub async fn notify<T: UnderRoot<Root = ExtHostNotif>>(t: T) {
pub async fn notify<T: UnderRoot<Root = api::ExtHostNotif>>(t: T) {
get_client().notify(t).await.unwrap()
}