Repository navigation
perf(dispatch): enable sync short-circuit for sync routes with path parameters (#254) - #261
Merged
Merged
Conversation
ZhuchkaTriplesix
force-pushed
the
issue-254-sync-path-params
branch
from
October 18, 2026 15:41
8c88d42 to
7a7fad9
Compare
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.
Closes #254
Summary of Changes
src/lib.rs):all_path_param_names(&path)to extract all:nameand*nameparameter names declared in a route template.trivial_synccheck: instead of strictly requiringhandler_param_names.is_empty(), synchronous routes are eligible fortrivial_syncas long as!handler_varkw, no reserved parameter names (query,request,scope, etc.) are present, andhandler_param_names == path_params.**kwargs, non-path parameters, query parameters, request bodies, JWT auth, dependencies, or rate limits correctly defer to the full async pipeline.src/dispatch.rs):try_rsgi_sync_short_circuit: passed matchedparams: &matchit::Paramstorun_trivial_sync_route.run_trivial_sync_route: when path parameters are present, constructedkwargs: PyDictwith coerced path parameters (coercing:nameand preserving*wildcardstrings as inrun_rsgi) and calledhandler.call((), Some(&kwargs)). When no parameters are present, invokedhandler.call0().tests/test_sync_rsgi_short_circuit.py):/items/:id)/users/:user_id/posts/:slug)/static/*filepath)**kwargsroute handlers correctly deferring to async pipeline