rename flowy-dispatch structs

This commit is contained in:
appflowy
2021-12-04 11:26:17 +08:00
parent 76691e3e8c
commit c649673b2b
8 changed files with 40 additions and 40 deletions

View File

@ -18,7 +18,7 @@ lazy_static! {
static ref FLOWY_SDK: RwLock<Option<Arc<FlowySDK>>> = RwLock::new(None);
}
fn dispatch() -> Arc<EventDispatch> { FLOWY_SDK.read().as_ref().unwrap().dispatch() }
fn dispatch() -> Arc<EventDispatcher> { FLOWY_SDK.read().as_ref().unwrap().dispatcher() }
#[no_mangle]
pub extern "C" fn init_sdk(path: *mut c_char) -> i64 {
@ -42,7 +42,7 @@ pub extern "C" fn async_event(port: i64, input: *const u8, len: usize) {
port
);
let _ = EventDispatch::async_send_with_callback(dispatch(), request, move |resp: EventResponse| {
let _ = EventDispatcher::async_send_with_callback(dispatch(), request, move |resp: EventResponse| {
log::trace!("[FFI]: Post data to dart through {} port", port);
Box::pin(post_to_flutter(resp, port))
});
@ -52,7 +52,7 @@ pub extern "C" fn async_event(port: i64, input: *const u8, len: usize) {
pub extern "C" fn sync_event(input: *const u8, len: usize) -> *const u8 {
let request: ModuleRequest = FFIRequest::from_u8_pointer(input, len).into();
log::trace!("[FFI]: {} Sync Event: {:?}", &request.id, &request.event,);
let _response = EventDispatch::sync_send(dispatch(), request);
let _response = EventDispatcher::sync_send(dispatch(), request);
// FFIResponse { }
let response_bytes = vec![];