pub struct LspDaemon { /* private fields */ }Expand description
The daemon runtime that manages language server processes and multiplexes client connections.
LspDaemon listens on a Unix domain socket and routes LSP requests from multiple LspClient connections to the appropriate language server subprocess. Language servers are spawned on demand and shared across clients working in the same workspace.
§Usage
use aether_lspd::LspDaemon;
use std::path::PathBuf;
use std::time::Duration;
let daemon = LspDaemon::new(
PathBuf::from("/tmp/aether-lspd-1000/lsp-rust-abc123.sock"),
Some(Duration::from_secs(300)),
);
daemon.run().await?;§Lifecycle
- Bind – Acquires a lockfile and binds the Unix socket.
- Listen – Accepts client connections and spawns a handler task per client.
- Shutdown – Triggered by any of: SIGTERM/SIGINT, idle timeout, or all workspace roots being deleted from disk. On shutdown the daemon stops all language servers and removes the socket file.
§Idle timeout
When idle_timeout is Some, the daemon shuts down after the specified duration with zero connected clients. Activity resets whenever a client connects or disconnects.
§Workspace liveness
The daemon periodically checks whether the workspace directories it manages still exist on disk. If every registered workspace root has been deleted, the daemon shuts down automatically.
Implementations§
Auto Trait Implementations§
impl Freeze for LspDaemon
impl !RefUnwindSafe for LspDaemon
impl Send for LspDaemon
impl Sync for LspDaemon
impl Unpin for LspDaemon
impl UnsafeUnpin for LspDaemon
impl !UnwindSafe for LspDaemon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more