Repository navigation
Detach terminated children, onTerminate() unsubscribe, saturating withTimeout(); release 0.2.0 - #5
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Fixes #1
Fixes #2
Fixes #3
Fixes #4
Release 0.2.0 folded in (
CHANGELOG.md## 0.2.0 — 2026-10-11).Changes
#1 — detach terminated children; unsubscribe
ContextStatedetaches from its parent and drops its listeners and children, so a long-lived parent no longer retains every cancelled/expired child it derived. A child derived from an already-terminated parent is terminated and not retained.withValue()shares its parent's state (it has no controller), instead of attaching one new child per call.onTerminate()returns an unsubscribe\Closure(): void(idempotent; no-op once the listener ran). roave reports no break (final class, callers ignoring the value unaffected); released as 0.2.0 by decision.#2 —
withTimeout()overflownow); a timeout beyond the representable range saturates atPHP_INT_MAXinstead of overflowing via an out-of-range float→int cast.#4 — portable deadline: documented the pattern (send
(int) remainingMs(), rebuild withwithTimeout($ms / 1000)capped by the receiver's limit) and pinned it with a test. No new API.#3 — docs and tests
README.ru.mdadded; leftover migration template removed fromAGENTS.md; CHANGELOG 0.1.0 entry now says what 0.1.0 contains.Classify::cover, examples); value lookup finds the nearest ancestor. Existing deadline properties kept.Also:
ContextExpiredExceptiontakes an optional$previous(forcontext-httpto keep the transport timeout as the cause); regression-corpus restore/PROPERTY_DB/save steps in the coverage job (zizmor clean); multi-line@apidocblocks.Verification (local)
composer build: green (38 tests).minMsi85). New code leaves only the two equivalent mutants at the saturation boundary (>=/>and a float cast); the other 5 survivors predate this PR.composer rector: clean.composer bc-check:Detected last version: v0.1.0, no backwards-incompatible changes.php -lon PHP 8.3: clean.bin/package-audit: 0 errors.zizmor --persona=auditor .github/: no findings.