Expand description
sopht is a program for managing long running processes in a (slightly) more sophisticated way than something like tmux. this library currently implements the IPC protocol sopht uses to pass commands and responses between clients and a server, as well as the machinery required for starting and managing child processes
Structs
- arguments to
State::change_restart_policy - structure containing the state of a connection to the sopht socket
- contains all information about a running or previously-running process, including the
Childstructure and the handles to the threads reading the output streams of the process. this structure also maintains aVec<String>containing all the output lines of its child process. for more info about how this output is read and stored, seeProcess::start - detailed status of a
Process. this structure is generated byState::status_of - represents a response from the server to the client. this should never be received by a server. additionally, this structure is subject to change in the future as responses get more detailed
- arguments to
State::send - arguments to
State::start - the state of the sopht process manager. contains all processes started and all other configuration/state
Enums
- represents a command to be executed by a server. this should never be received by a client.
- union of all errors resulting from sopht functions. this type implements
DisplayandError, and is the error type ofsopht::Result. - how sopht internally represents the exit status of a process
- union of all different message types. currently the only two message types are
CommandandResponse. theCommandvariant should only ever be sent by clients and received by servers, and theResponsevariant should only ever be received by clients and sent by servers - describes the conditions under which a process will be restarted in an upkeep cycle. this has no effect on
State::restart
Functions
- creates a
UnixStreamand attempts to build aConnectionout of it. if the stream cannot be created, this function returnsSocketError - attempts to create the local directories required for sopht
- obtains the file path of the unix socket file on the local machine whether it exists or not. this function can fail if the current user has no HOME directory (
NoHomeDir)
Type Aliases
- PIDs are represented internally by a plain
usize, though this may change in the future! - specialized
Resulttype for return values from sopht functions