chore: lib-dispatch wasm build (#4307)

* chore: lib-dispatch wasm build

* chore: add wasm crate

* chore: add wasm demo

* chore: fix test
This commit is contained in:
Nathan.fooo
2024-01-06 00:37:26 +08:00
committed by GitHub
parent ecbc2601c4
commit 89370b4a55
11 changed files with 85 additions and 77 deletions

View File

@ -11,9 +11,10 @@ pub async fn hello() -> String {
async fn test() {
let event = "1";
let runtime = Arc::new(AFPluginRuntime::new().unwrap());
let dispatch = Arc::new(AFPluginDispatcher::construct(runtime, || {
vec![AFPlugin::new().event(event, hello)]
}));
let dispatch = Arc::new(AFPluginDispatcher::new(
runtime,
vec![AFPlugin::new().event(event, hello)],
));
let request = AFPluginRequest::new(event);
let _ = AFPluginDispatcher::async_send_with_callback(dispatch.clone(), request, |resp| {
Box::pin(async move {