Skip to content

feat(host): thread-safe send/query (io lock) + py.typed (0.2.1)#30

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/io-lock-and-pytyped
Jun 28, 2026
Merged

feat(host): thread-safe send/query (io lock) + py.typed (0.2.1)#30
CameronBrooks11 merged 1 commit into
mainfrom
feat/io-lock-and-pytyped

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Two correctness fixes surfaced by the fiberpath machine cutover (fiberpath/fiberpath#195):

  • io locksend()/query() (and thus stream()'s per-line sends, temperatures(), position()) now serialise transport access via an internal threading.Lock, so a background stream worker and a concurrent manual command can't interleave on the wire. emergency_stop() deliberately bypasses it (#196 — M112 must preempt). Closes the paused-manual-send race in the API job runner.
  • py.typed — ship the marker so consumers (fiberpath) type-check against the real MarlinHost API instead of ignore_missing_imports.

Deterministic mutual-exclusion test added; 119 pass, just check clean, py.typed verified in the built wheel.

- Add an internal io lock so send()/query()/stream() are mutually
  thread-safe: a worker streaming while another thread issues a manual
  command no longer races on the transport. emergency_stop() bypasses it
  (M112 must preempt, not wait behind an in-flight line). Closes the
  paused-send race the fiberpath job runner hit (fiberpath/fiberpath#195).
- Ship a py.typed marker so consumers type-check against the real API
  (was import-untyped, forcing an ignore_missing_imports override).

Deterministic mutual-exclusion test; 119 tests pass.
@CameronBrooks11
CameronBrooks11 merged commit 56ae376 into main Jun 28, 2026
5 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/io-lock-and-pytyped branch June 28, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant