Skip to main content

Module controller

Module controller 

Source
Expand description

controller submodule. stryke controller — Interactive REPL for coordinating stress test agents.

§Usage

stryke controller                    # listen on 0.0.0.0:9999
stryke controller --port 8888        # custom port
stryke controller --bind 10.0.0.1    # specific interface

§Commands

  • status — list connected agents
  • fire [duration] — start stress test on all agents
  • fire node1,node2 [duration] — specific agents
  • terminate — stop stress test
  • shutdown — disconnect all agents and exit
  • help — show commands

Structs§

Controller
Controller state
ControllerHandle
Non-blocking handle to a running Controller. Returned by spawn_controller; used by the scriptable builtins to drive the distributed compute fabric from .stk code.

Functions§

cathedral_lookup
Look up a congregation name → endpoint. Returns None if unregistered.
cathedral_names
Enumerate registered congregation names (sorted).
cathedral_register
Register a congregation name → endpoint binding. Returns the previous binding if any (so caller can detect collisions if it cares).
cathedral_unregister
Remove a name from the registry. Returns the endpoint that was bound.
get_chant
get_chant — see implementation.
get_controller
Look up a controller by its script-visible ID. Returns None if the ID was never registered or has been unregistered.
get_current_controller
Return the current implicit controller, or None if no congregation / ordination has happened yet in this process.
get_divination
Look up a divination’s (controller_id, petition_id) pair.
print_help
Print controller help
register_chant
Register a chant in the global registry; returns the script-visible chant_id. The pair stored is (controller_id, controller_local_chant_id).
register_controller
Register a controller handle; returns a script-visible u64 ID.
register_divination
Register a divination; returns a script-visible u64 ID that resolves back to (controller_id, petition_id) via get_divination.
run_controller
Main entry point — back-compat wrapper that delegates to spawn_controller + ControllerHandle::run_repl_blocking. Preserves the historical CLI behaviour: bind, accept agents in a background thread, run the interactive REPL on the main thread, cleanly join the accept thread on REPL exit. Scripts that want non-REPL programmatic access use spawn_controller directly.
set_current_controller
Make controller_id the implicit target for subsequent pray / muster / annex calls that don’t name a controller.
spawn_controller
Bind a listener and start the accept thread, return a non-blocking handle. Pass port = 0 to let the OS pick a free port; recover the chosen one via ControllerHandle::listen_addr.
unregister_chant
unregister_chant — see implementation.
unregister_controller
Remove a controller from the registry. Caller typically also calls shutdown() on the returned Arc before dropping it.
unregister_divination
Remove a divination from the registry. Returns the (controller_id, petition_id) pair so the caller can route the actual gather request.