diff --git a/Cargo.toml b/Cargo.toml
index bb42113..9369aee 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,3 +29,4 @@ tonic-build = "0.9"
default = ["proto", "global"]
proto = ["dep:prost"]
global = ["dep:lazy_static"]
+sync = []
diff --git a/src/client.rs b/src/client.rs
index 903833d..60c911b 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -42,6 +42,7 @@ impl Client {
}
pub fn leave_workspace(&mut self) {
+ // TODO need to stop tasks?
self.workspace = None
}
diff --git a/src/instance.rs b/src/instance.rs
index b7772be..fd5b481 100644
--- a/src/instance.rs
+++ b/src/instance.rs
@@ -1,75 +1,171 @@
-use std::sync::{Arc, Mutex};
-
-use tokio::runtime::Runtime;
-
-use crate::{
- buffer::controller::BufferController,
- errors::Error, client::Client, cursor::controller::CursorController,
-};
-
#[cfg(feature = "global")]
pub mod global {
+ #[cfg(not(feature = "sync"))]
lazy_static::lazy_static! {
- pub static ref INSTANCE : super::Instance = super::Instance::default();
+ pub static ref INSTANCE : super::a_sync::Instance = super::a_sync::Instance::default();
+ }
+
+ #[cfg(feature = "sync")]
+ lazy_static::lazy_static! {
+ pub static ref INSTANCE : super::sync::Instance = super::sync::Instance::default();
}
}
-pub struct Instance {
- client: Mutex