From 2ae05a6163d8b15f3d8a18a2ab713d1fbd83c505 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Dec 2018 13:18:55 +0300 Subject: vfs crate scaffold --- crates/thread_worker/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/thread_worker') diff --git a/crates/thread_worker/src/lib.rs b/crates/thread_worker/src/lib.rs index e558559ef..24d7fcce1 100644 --- a/crates/thread_worker/src/lib.rs +++ b/crates/thread_worker/src/lib.rs @@ -30,7 +30,7 @@ where impl Worker { /// Stops the worker. Returns the message receiver to fetch results which /// have become ready before the worker is stopped. - pub fn stop(self) -> Receiver { + pub fn shutdown(self) -> Receiver { self.out } @@ -45,11 +45,11 @@ impl WorkerHandle { WorkerHandle { name, thread, - bomb: DropBomb::new(format!("WorkerHandle {} was not stopped", name)), + bomb: DropBomb::new(format!("WorkerHandle {} was not shutdown", name)), } } - pub fn stop(mut self) -> thread::Result<()> { + pub fn shutdown(mut self) -> thread::Result<()> { log::info!("waiting for {} to finish ...", self.name); let name = self.name; self.bomb.defuse(); -- cgit v1.2.3 From a5ef8ad05b7c1f7148c59814b55d641fd75aff75 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 19 Dec 2018 15:04:15 +0300 Subject: swtich lsp server to vfs --- crates/thread_worker/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/thread_worker') diff --git a/crates/thread_worker/src/lib.rs b/crates/thread_worker/src/lib.rs index 24d7fcce1..12e8bf17e 100644 --- a/crates/thread_worker/src/lib.rs +++ b/crates/thread_worker/src/lib.rs @@ -37,6 +37,9 @@ impl Worker { pub fn send(&self, item: I) { self.inp.send(item) } + pub fn recv(&self) -> Option { + self.out.recv() + } } impl WorkerHandle { -- cgit v1.2.3