Repository navigation
Pyjoyment: the heartbeat of a stream of Server-Sent Events or of a WebSocket, of a helper or of a route - #614
Merged
Merged
Conversation
…lue heartbeat of the stash of a route A comment of Server-Sent Events every so many seconds, once the response is a stream of text/event-stream, or the pings of a WebSocket with heartbeat of its transaction, so that proxies and load balancers with an idle timeout of their own, and the inactivity timeout of the connection, keep a stream that waits, as for a model of language. Mojolicious leaves the comments to the application. The value heartbeat of the stash of a route, of its defaults or of a route of under before it, sets it before the first action, and is a reserved stash value. Part of #266 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Docker Smoke Test
|
Contributor
Tests
|
3 tasks done
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.
The third step of #266, stacked on #612: the keepalive of streams that wait, as for a model of language, so that proxies and load balancers with an idle timeout of their own, and the inactivity timeout of the server, keep them.
Changes
heartbeat(interval=20, timeout=20):: heartbeateveryintervalseconds once the response is a stream oftext/event-stream, which Mojolicious leaves to the application, as the documentation ofwrite_ssesays;heartbeatof its transaction, which closes the connection of a peer that does not answer intimeout;Nonestops it, and the timer goes with the end of the transaction.heartbeatof the stash of a route, of its defaults or of a route ofunderbefore it, sets it before the first action, as the timeouts of Pyjoyment: the timeouts of a route, inactivity_timeout and request_timeout, with a 504 after its deadline #612 do:r.get('/events', {'heartbeat': 15}). It is a reserved stash value.Controller.stash, the routing guide and the skillasync.Validation
t/Pyjoyment/heartbeat_lite_app.pywith an inactivity timeout of the server of 0.3 seconds, which the bytes of a stream show, as the user agent leaves the comments out of its events: comments while it waits and the event after them, none and a closed stream without a heartbeat, the helper and its stop, a response that is not a stream, and the pings of a WebSocket that keep it openPyjo.Reactor.Poll, and on the reactors of Uvloop, gevent, Twisted and TrioPYTHONDEVMODE=1, without aResourceWarningor an unhandled rejected promise-W,trunk checkPart of #266
🤖 Generated with Claude Code