Module client_monitor

Source
Available on crate feature client-monitor only.
Expand description

Stop the main loop when the Language Client process aborted unexpectedly.

Only applies to Language Servers.

Typically, the Language Client should send exit notification to inform the Language Server to exit. While in case of it unexpected aborted without the notification, and the communicate channel is left open somehow (eg. an FIFO or UNIX domain socket), the Language Server would wait indefinitely, wasting system resources.

It is encouraged by LSP specification that,

If the parent process (processId) is not alive then the server should exit (see exit notification) its process.

And this middleware does exactly this monitor mechanism.

Implementation: See crate waitpid_any.

Structs§

ClientProcessMonitor
The middleware stopping the main loop when the Language Client process aborted unexpectedly.
ClientProcessMonitorBuilder
The builder of ClientProcessMonitor middleware.

Type Aliases§

ClientProcessMonitorLayer
A type alias of ClientProcessMonitorBuilder conforming to the naming convention of tower_layer.