proclaunch
Start and stop long-running local background processes, detached and windowless, with process identity (pid and
creation time), exclusive start reservations, readiness probes and an optional OS supervisor (Windows Task
Scheduler). It defines its own BackgroundLauncher / Supervisor ports and launch types (proclaunch.domain, proclaunch.ports).
from proclaunch.api import launch_background, start_service, stop_service
from proclaunch.domain import ProcessSpec
result = launch_background(ProcessSpec(("python", "-m", "myapp"))) # a LaunchResult; never raises
if not result.ok:
print(result.error)
A named service (ProcessSpec(name=...)) is recorded so a second start is ALREADY_RUNNING, and a stop only acts
when the recorded identity still matches (a reused pid is left alone).
Tests: bind proclaunch.testing.FakeLauncher with proclaunch.api.use_launcher(...) and
FakeSupervisors with use_supervisor(...).
Replacing one collaborator
The operations keep proclaunch's invariants (exclusive reservation, pid + creation-time identity, the record); what starts the process, how identity is read, where records live and the clock can each be replaced on its own:
from proclaunch.api import PtySpawner, default_manager, start_service
# a different way to start the process; reservation, identity and records stay proclaunch's
start_service(ProcessSpec(("claude", "remote-control"), name="rc"), state_dir=state, spawner=PtySpawner())
manager = default_manager(state, spawner=PtySpawner()) # or hold a manager and use it repeatedly
proclaunch.api.__all__ is the supported surface: the operations, the values they return, the ports you may
implement (ProcessSpawner, Probe, Supervisor, ...) and the ready-made implementations (SubprocessSpawner,
PtySpawner, HttpProbe, TcpProbe, CallableProbe). A launcher bound with use_launcher (a test seam) takes
precedence over an injected spawner, so code that injects one cannot start a real process inside a test.
Metadata
Release files for proclaunch 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| proclaunch-0.2.0.tar.gz | 25.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| proclaunch-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.5 kB
Release files / proclaunch-0.2.0.tar.gz
| Download URL | proclaunch-0.2.0.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9d65b3eb2c8243693477e1ba4d238fb13ea7e4bec74eebd75411c65e288dbf2
|
|
BLAKE2b-256 checksum How to use checksums |
6d7674737f5711695d98921d2b135346c0a5f28d4b257991b16705ccb61aa7a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / proclaunch-0.2.0-py3-none-any.whl
| Download URL | proclaunch-0.2.0-py3-none-any.whl |
|---|---|
| Size | 33.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23df5d5bf4b2044a4d94f3ab41935e34bd6b1a1b7bde80e0c2124b9b0c994a72
|
|
BLAKE2b-256 checksum How to use checksums |
8bcf51940023c30580ffd2827baddcfce016a1479d0f781bc7c5b3edc8336bbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|