Repository navigation
Pyjoyment: the timeouts of a route, inactivity_timeout and request_timeout, with a 504 after its deadline - #612
Merged
Merged
Conversation
…tarts with to one that starts with it As "req" for "request" of another framework, which the helper request_timeout, that starts with it and is closer, would take otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…meout of its stash, and the helper request_timeout The values of the stash of a route, of its defaults or of a route of under before it, set the inactivity timeout of the connection and the most time to the end of the response before its first action. When the time of request_timeout passes, the actions that are coroutine functions are cancelled where they wait, with the requests of the user agent that they wait for, and the request gets an empty 504 response, or the connection closes when the response has started already. Both names are reserved stash values, which a placeholder cannot have. Part of #266 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Docker Smoke Test
|
Contributor
Tests
|
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 second step of #266, stacked on #611: the timeouts of a route, as the inactivity timeout of a connection that waits for a model of language, and the most time to the end of a response.
Changes
The values
inactivity_timeoutandrequest_timeoutof the stash of a route, of its defaults or of a route ofunderbefore it, are set before its first action:r.post('/chat', {'inactivity_timeout': 600, 'request_timeout': 120}), or for a group,r.under('/llm', {...}). The keyword arguments of a route are the constraints of its placeholders, so the timeouts are values of the stash, as the other special values; both are reserved stash values, with# Unlike Mojolicious:.The helper
request_timeout, the deadline of a request, which Mojolicious does not have, with the name ofrequest_timeoutof the user agent. When it passes:504, or the connection closes when the response has started already, as a stream;Request timeout of N secondsoninfo.The timer goes with the end of the transaction, and a later call replaces it.
Pyjo.Util._suggest: a name that the mistaken one starts with comes before one that starts with it, asreqforrequestof another framework, which the new helperrequest_timeoutwould take otherwise;t/Pyjoyment/hints_lite_app.pycaught it.Docs: the helper, the reserved stash values of
Controller.stash, a paragraph of the routing guide on the timeouts of a route and of a group, and the skillasync.Pyjoyment, Pyjo.Promise: async actions and their requests are cancelled when the connection closes #611 gets a fix of its test:
then(lambda: client.cancel())adopted the rejection of the promise thatcancelreturns, which was reported as an unhandled rejected promise.Validation
t/Pyjoyment/timeouts_lite_app.pyon asyncio andPyjo.Reactor.Poll: the inactivity timeout of the server and the longer one of a route, the deadline of a route, of the helper, of a group, and of an action with a callback, which gets504, of a stream, whose connection closes without its last chunk, and one that does not pass after a responsePyjo.Reactor.PollwithPYTHONDEVMODE=1, without aResourceWarningor an unhandled rejected promise-W,trunk checkPart of #266
🤖 Generated with Claude Code