feat(host): thread-safe send/query (io lock) + py.typed (0.2.1)#30
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two correctness fixes surfaced by the fiberpath machine cutover (fiberpath/fiberpath#195):
send()/query()(and thusstream()'s per-line sends,temperatures(),position()) now serialise transport access via an internalthreading.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.MarlinHostAPI instead ofignore_missing_imports.Deterministic mutual-exclusion test added; 119 pass,
just checkclean, py.typed verified in the built wheel.