Server Resource Handlers¶
lsp_utils.ServerStatus
¶
A ServerStatus enum for use as a return value from ServerResourceInterface.get_status().
lsp_utils.ServerResourceInterface
¶
Bases: ABC
Interface for implementating server resource handlers.
Use this interface in plugins that manage their own
server binary (GenericClientHandler.manages_server returns True).
After implementing this interface, return an instance of implemented class from
GenericClientHandler.get_server().
needs_installation
abstractmethod
¶
needs_installation() -> bool
Check whether the binary needs an update, or whether it needs to be installed before starting server.
Returns:
| Type | Description |
|---|---|
bool
|
|
install_or_update
abstractmethod
¶
Do the actual update/installation of the server binary.
Don't start extra threads to do the work as everything is handled automatically.
get_status
abstractmethod
¶
get_status() -> int
Determine the current status of the server.
The state changes as the server is being installed, updated or
runs into an error doing those. Initialize with ServerStatus.UNINITIALIZED and change to either
Set to ServerStatus.ERROR or ServerStatus.READY depending on if the server was installed
correctly or is already installed.
Returns:
| Type | Description |
|---|---|
int
|
A number corresponding to the |