Repository navigation
Keep the worker serving after the first request; test on the rapira/testing doubles - #4
Merged
Merged
Conversation
`Rapira\handle_request()` takes a `callable(): bool` and keeps the worker serving only while it answers true. The handler returned nothing, so a worker could end after its first request and be restarted by the host, which turns Worker mode into Classic. The bridge's own test runtime ignored the result and hid it. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
test: script the Rapira runtime with FakeRuntime, FakeHttpDispatcher and FakeExchange from rapira/testing The internal `Runtime` existed only so tests could replace the extension. Since rapira/contract 0.9.1 the contract's own stubs answer through a replaceable runtime, so the runner calls `Rapira\*` directly and `Runner` loses its internal constructor parameter. The local fakes give way to the shared ones in rapira/testing 0.1.6. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
A streamed callback that calls `ob_flush()` needs an open buffer. php-fpm has one from `output_buffering`; the Rapira SAPI starts without, so the call raised a notice that Laravel turned into an exception after the first chunk, and Classic and Worker mode cut streamed responses short. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
🔍 What was changed
true.Rapira\handle_request()takes acallable(): booland keeps the worker serving only while it answers true; the handler returned nothing, so a worker could end after its first request and be restarted by the host — Worker mode silently behaving like Classic.ob_flush()needs one; php-fpm has it fromoutput_buffering, the Rapira SAPI starts without, so the notice became an exception after the first chunk and streamed responses were cut short. The acceptance suite now runs and caught it.Runtime/ExtensionRuntimeseam is gone: the runner callsRapira\get_mode(),get_dispatcher(),handle_request()andrapira_finish_request()directly.Runner's constructor loses its internal$runtimeparameter.FakeRuntime,FakeHttpDispatcherandFakeExchangefromrapira/testinginstead of the local copies.Why?
The seam existed only so tests could replace the extension. Since
rapira/contract0.9.1 the contract's own stubs answer through a replaceable runtime, andrapira/testingships the doubles the yii and laravel bridges each kept a copy of.Checklist
Unit(31) andFeature(21) suites pass locally againstrapira/contract0.9.1 and therapira/testingdoubles from feat(testing): add runtime and HTTP doubles; carry file paths as Path sdk-php#7void, the Worker-mode feature tests fail (one request served instead of two) — the old local fake ignored the resultrapirain Worker modeReview notes
rapira/testing0.1.6 (feat(testing): add runtime and HTTP doubles; carry file paths as Path sdk-php#7) released first — CI stays red until then.