iox v0.3.6 — Clarify semantic control classification #28
hayabusa-cloud
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Introduction
Package
ioxprovides non-blocking I/O semantics for Go, extending the standardiopackage with explicit control outcomes for readiness suspension and live streaming or multishot frontiers while preserving ordinaryio.Readerandio.Writercompatibility.Blocking I/O code often treats
(count, error)as a simple success or failure boundary. Non-blocking and streaming I/O also need to expose "not ready yet" and "this operation is still alive."ioxmakes both cases explicit:ErrWouldBlockmeans the immediate attempt reached a no-progress readiness boundary and should be retried only after readiness or event evidence, whileErrMoremeans the current observation is usable and the same logical operation can yield later observations before it terminates, is canceled, or fails.This release tightens the public classification contract around semantic-control outcomes.
ErrWouldBlockandErrMoreremain non-failure control outcomes; callers should process the returned count first, then use helpers such asIsMore,IsWouldBlock,IsSemantic,IsNonFailure,IsFailure, orClassifyto choose the next control action.The package now exposes
IsFailure(err error) boolfor the direct failure case: it reports true only for actual failures, not fornil,ErrWouldBlock, orErrMore. The documentation also separates wrapped semantic classification at API boundaries from exact sentinel identity used by internal hot-path policy dispatch.Usage
Highlights
The main change is clearer public vocabulary for the four observable outcomes: terminal success, live-frontier continuation, readiness suspension, and actual failure.
IsFailuregives callers a direct helper for the failure case when they need it, while the canonical loop can continue to branch onIsMore,IsWouldBlock, and ordinary error return.The GoDoc and README guidance now consistently say to prefer
ioxsemantic helper predicates for ordinary classification. Wrapped semantic sentinels still classify correctly through the helpers, while internal copy and tee policy dispatch intentionally depends on exact unwrapped sentinels for hot-path retry decisions.What's Changed
Features
IsFailure(err error) boolto classify actual failures directly without treatingErrWouldBlockorErrMoreas failures (docs: clarify semantic control documentation #27)Documentation
CopyNterminal behavior, helper-based classification, and exact sentinel dispatch for hot paths (docs: clarify semantic control documentation #27)Tests
ErrMoreclassification and for policy dispatch returning wrapped semantic sentinels without exact-sentinel retry (docs: clarify semantic control documentation #27)Compatibility
This discussion was created from the release iox v0.3.6 — Clarify semantic control classification.
Beta Was this translation helpful? Give feedback.
All reactions