27 lines
602 B
Rust
Raw Normal View History

2021-09-23 17:50:28 +08:00
use crate::service::{doc::ws_handler::DocWsBizHandler, ws::WsBizHandlers};
use flowy_ws::WsSource;
use std::sync::Arc;
use tokio::sync::RwLock;
2021-09-23 16:10:24 +08:00
pub mod app;
pub mod doc;
2021-09-16 13:41:07 +08:00
pub(crate) mod log;
2021-09-23 16:10:24 +08:00
pub mod user;
2021-09-11 14:26:30 +08:00
pub(crate) mod util;
2021-09-23 16:10:24 +08:00
pub mod view;
pub mod workspace;
pub mod ws;
2021-09-23 17:50:28 +08:00
pub fn make_ws_biz_handlers() -> WsBizHandlers {
let mut ws_biz_handlers = WsBizHandlers::new();
// doc
let doc_biz_handler = DocWsBizHandler::new();
ws_biz_handlers.register(WsSource::Doc, wrap(doc_biz_handler));
//
ws_biz_handlers
}
fn wrap<T>(val: T) -> Arc<RwLock<T>> { Arc::new(RwLock::new(val)) }