Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

dockpoint

Cross-platform primitives for the auto-spawning client-daemon pattern.

Like tmux, ssh-agent, gpg-agent, and docker — a frontend CLI either connects to an existing background daemon or spawns one on demand. dockpoint provides the low-level mechanism: a canonical, well-known communication point that only one process can claim, with clients finding and connecting to it.

  • POSIX: Unix-domain socket with a sidecar lock file for coordination
  • Windows: named pipe scoped to the current user's SID

Concepts

A Dockpoint is a claimed endpoint — the well-known rendezvous point that only one process can hold. It accepts incoming client connections and releases the OS resource when closed. Supports the context manager protocol.

The daemon calls dockpoint.claim() to claim a Dockpoint, then calls .accept() on it to receive connections.

A DockpointConnection is a connected byte stream between the daemon and one client. Clients obtain one by calling dockpoint.connect().

API

dockpoint.claim(app_name, instance="default") → Dockpoint | None

Claim the canonical endpoint and return a Dockpoint object. Returns None if another process already owns it.

Dockpoint.accept() → DockpointConnection

Accept the next incoming client connection.

Dockpoint.close()

Release the endpoint.

dockpoint.connect(app_name, instance="default") → DockpointConnection | None

Connect to an existing endpoint. Returns None if no daemon is listening.

DockpointConnection.read(max_bytes=65536) → bytes

Read up to max_bytes from the stream.

DockpointConnection.write(data) → int

Write data to the stream. Returns the number of bytes written.

DockpointConnection.close()

Close the connection.

The pattern

dockpoint implements the rendezvous and mutual-exclusion layer for:

A: Shared protocol / definitions
B: Daemon   ── calls dockpoint.claim(), serves connections
C: Frontend ── calls dockpoint.connect(), auto-spawns B if needed

The auto-spawn logic (detect → spawn → retry-connect) lives above dockpoint, but the critical race-free primitives — atomic endpoint claim and well-known rendezvous — are what dockpoint provides.

Usage sketch

import dockpoint

# B (daemon) side
dp = dockpoint.claim("my-app")
if dp is None:
    print("Another daemon is already running.")
    exit(1)

with dp:
    while True:
        conn = dp.accept()
        data = conn.read()
        conn.write(b"ack")
        conn.close()
import dockpoint

# C (client) side
conn = dockpoint.connect("my-app")
if conn is None:
    # No daemon — spawn one and retry
    ...

conn.write(b"hello\n")
reply = conn.read()
conn.close()

Why the name

A dock is a fixed, well-known place. A dockpoint is the specific spot on that dock where you tie up. One process claims the dockpoint and holds it. Others arrive at the dockpoint to communicate.

Contributing

Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.

License

This project is licensed under the MIT License.

Release files for dockpoint 0.1.0a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dockpoint 0.1.0a0
File Size Uploaded
dockpoint-0.1.0a0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dockpoint 0.1.0a0
File Interpreter ABI Platform
dockpoint-0.1.0a0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 17.4 kB

Release files / dockpoint-0.1.0a0.tar.gz

Download URL dockpoint-0.1.0a0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ee446d93687f770a786a9d1221442a1d58c7d8d00dfb9dbd9acb1dfd4ba00d06
BLAKE2b-256 checksum
How to use checksums
ac3e6783a08ab6d4a9a4fbce8f9ff1314995dc69fe65e464fb5c625295487478
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / dockpoint-0.1.0a0-py2.py3-none-any.whl

Download URL dockpoint-0.1.0a0-py2.py3-none-any.whl
Size 8.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1035b1fff7036d7cec0490bf3940949c9a73f32c252eea0ca47b659f7b421c4c
BLAKE2b-256 checksum
How to use checksums
a753679037c15e9018c8b5a2eebdb8fd1fa5a08b9ccc5f2babe77b0c70254fb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.1.0a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page