-
Notifications
You must be signed in to change notification settings - Fork 84
Draft: asynchronous phase handler #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
4a7588b to
315d8e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces asynchronous capabilities to the Rust SDK for nginx modules, including async phase handlers, subrequests, and type-safe request context management.
Key Changes:
- Introduces
AsyncHandlertrait and supporting infrastructure for asynchronous HTTP request handling - Adds
RequestContexttrait for type-safe request-specific context data management - Implements
TypeStoragetrait for storing typed values in nginx memory pools - Refactors existing examples to use new
HttpRequestHandlertrait andadd_phase_handlerfunction
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/log.rs | Extracts connection to intermediate variable in logging macro |
| src/http/status.rs | Adds From<HTTPStatus> implementation for ngx_int_t |
| src/http/request_context.rs | Implements RequestContext trait for managing request-specific context |
| src/http/request.rs | Adds HttpHandlerReturn and HttpRequestHandler traits, new request methods |
| src/http/mod.rs | Adds async_request module exports (feature-gated) |
| src/http/conf.rs | Adds HttpPhase enum and add_phase_handler function |
| src/http/async_request.rs | Implements async handler infrastructure and subrequest builder |
| src/core/type_storage.rs | Implements TypeStorage trait for pool-based type storage |
| src/core/pool.rs | Adds remove method for cleaning up pool-allocated values |
| src/core/mod.rs | Exports new type_storage module |
| examples/*.rs | Refactors examples to use new handler registration pattern |
| examples/config | Adds async_request module configuration |
| examples/Cargo.toml | Adds async-related dependencies |
| Cargo.toml | Adds futures dependency |
| .github/workflows/nginx.yaml | Updates CI to load async_request module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
315d8e3 to
78a97e6
Compare
78a97e6 to
27338b6
Compare
Draft implementations of the following items are added to SDK: