Module daemon
Expand description
Daemon imlementation
Modulesยง
- workspace ๐
Structsยง
- Client ๐
- Representation of a client
- Daemon ๐
- The daemon is responsible to launch a client for each host, positioning the client windows, forwarding input records to all clients and handling control mode.
- HWND
Wrapper ๐ - Hacky wrapper around a window handle.
Enumsยง
- Control
Mode ๐State - Enum of all possible control mode states.
Constantsยง
- SENDER_
CAPACITY ๐ - The capacity of the broadcast channel used to send the input records read from the console input buffer to the named pipe servers connected to each client in parallel.
Functionsยง
- arrange_
client_ ๐window - Re-sizes and re-positions the given client window based on the total number of clients, the size of the daemon console window and its index relative to the other client windows.
- defer_
windows ๐ - Move all given windows to the foreground.
- determine_
client_ ๐spatial_ attributes - Calculates the position and dimensions for a client window given its index,
the total number of clients and the
aspect_ratio_adjustmentdaemon configuration. - ensure_
client_ ๐z_ order_ in_ sync_ with_ daemon - Spawns a background thread that ensures the z-order of all client windows is in sync with the daemon window. I.e. if the daemon window is focussed, all clients should be moved to the foreground.
- get_
console_ ๐rect - Transform the position and dimensions of a console window based on the workspace area.
- get_
console_ ๐window_ wrapper - Returns a window handle to the current console window.
- get_
foreground_ ๐window_ wrapper - Returns a window handle to the foreground window.
- launch_
client_ ๐console - Launchs a
clientconsole process with its own window with the given CLI arguments/options:host,username,port,debug. - launch_
clients ๐ - Launches a client console for each given host and waits for the client windows to exist before returning their handles.
- main
- The entrypoint for the
daemonsubcommand. - named_
pipe_ ๐server_ routine - Wait for the named pipe server to connect, then forward serialized input records read from the broadcast channel to the named pipe server.
- resolve_
cluster_ tags - Resolve cluster tags into hostnames
- toggle_
processed_ ๐input_ mode - The processed console input mode controls whether special key combinations
such as
Ctrl + corCtrl + BREAKreceive special handling or are treated as simple key presses.