2021-06-29 08:52:29 +00:00
|
|
|
use crate::helper::*;
|
|
|
|
use flowy_sys::prelude::*;
|
|
|
|
|
|
|
|
pub async fn hello() -> String { "say hello".to_string() }
|
|
|
|
#[test]
|
|
|
|
fn test_init() {
|
|
|
|
setup_env();
|
|
|
|
|
|
|
|
let event = "1";
|
|
|
|
let modules = vec![Module::new().event(event, hello)];
|
|
|
|
|
|
|
|
init_system(modules, move || {
|
2021-06-30 07:33:49 +00:00
|
|
|
let payload = SenderPayload::new(event);
|
|
|
|
|
|
|
|
let stream_data = SenderData::new(1, payload).callback(Box::new(|_config, response| {
|
2021-06-29 08:52:29 +00:00
|
|
|
log::info!("async resp: {:?}", response);
|
|
|
|
}));
|
|
|
|
|
|
|
|
let resp = sync_send(stream_data);
|
|
|
|
log::info!("sync resp: {:?}", resp);
|
|
|
|
|
|
|
|
stop_system();
|
|
|
|
});
|
|
|
|
}
|