Repository navigation
Backend: Server-Sent Events for handlers - #6218
shai-almog wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ared lengths available() is always 0 on both Web impls, so the previous guard flushed every read of every download. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Cloudflare Preview
|
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 210 screenshots: 210 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 26 Model 2 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 210 screenshots: 210 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 231 screenshots: 231 matched. |
|
Compared 195 screenshots: 195 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 210 screenshots: 210 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 210 screenshots: 210 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (baseline 1 performance regression:
Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
A change that moves performance ON PURPOSE records the new baseline in Result: performance regression |
|
Compared 210 screenshots: 210 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Handlers can now answer with an event stream, for LLM-proxy and live-feed endpoints where a WebSocket is more than the job needs:
What it is
Sse(vm/backend/src/com/codename1/backend/Sse.java) builds on the existingResponse.stream, which already does chunked HTTP/1.1, close-delimited HTTP/1.0 and flow-controlled HTTP/2. It adds the event-stream framing:data,json,event,id,retry,commentandping(), each flushed as soon as it is written.lastEventId(), so a reconnecting client resumes where it left off.Cache-Control: no-cacheandX-Accel-Buffering: no, so nginx does not hold events back.eventorid, or a NUL inid, is refused, so a value cannot forge an extra field.SseEmitteris out of scope, because the hand-off would needObject.waiton a virtual thread, which blocks the host.Fixes found on the way
Content-Encoding: gzipover identity bytes. Streamed responses are never compressed now.HttpProxy: it relayed an upstream event stream only when its 16 KB buffer filled, so a proxied token feed reached the client minutes late. It now flushes after every read fortext/event-streamand for bodies of undeclared length. Downloads with a declared length keep sending full 16 KB chunks.Tests
SseTestcovers:HttpProxy: the producer does not write its second event until the client has read the first, so any buffering times the test out.Last-Event-IDpassed through the proxy.Docs
A "Server-Sent Events" subsection in
Backend-Web.asciidoc, with a live-feed demo inStreaming.java.🤖 Generated with Claude Code