fix init folder manager bugs

This commit is contained in:
appflowy
2022-01-23 22:33:47 +08:00
parent 23c4924532
commit 10d99bdd8b
36 changed files with 205 additions and 157 deletions

View File

@ -1,4 +1,4 @@
use lib_dispatch::prelude::*;
use lib_dispatch::{prelude::*, util::tokio_default_runtime};
use std::sync::Arc;
pub async fn hello() -> String { "say hello".to_string() }
@ -8,7 +8,10 @@ async fn test() {
env_logger::init();
let event = "1";
let dispatch = Arc::new(EventDispatcher::construct(|| vec![Module::new().event(event, hello)]));
let runtime = tokio_default_runtime().unwrap();
let dispatch = Arc::new(EventDispatcher::construct(runtime, || {
vec![Module::new().event(event, hello)]
}));
let request = ModuleRequest::new(event);
let _ = EventDispatcher::async_send_with_callback(dispatch.clone(), request, |resp| {
Box::pin(async move {