Open
Conversation
4a7588b to
315d8e3
Compare
There was a problem hiding this comment.
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.
78a97e6 to
27338b6
Compare
xeioex
requested changes
Jan 24, 2026
| @@ -50,6 +50,7 @@ env: | |||
| NGX_TEST_FILES: examples/t | |||
| NGX_TEST_GLOBALS_DYNAMIC: >- | |||
| load_module ${{ github.workspace }}/nginx/objs/ngx_http_async_module.so; | |||
Contributor
There was a problem hiding this comment.
As we have native async support now, we should remove half-working ngx_http_async_module example and remove tokio dependency.
fc28783 to
697c039
Compare
697c039 to
db33cf9
Compare
xeioex
requested changes
Feb 5, 2026
db33cf9 to
e649eb8
Compare
Introduce RequestContext trait for managing request-specific context data: - Provides create, remove, get, get_mut, and exists methods - Uses pool allocation with cleanup handlers for memory management - Add get_module_ctx_mut method to Request for mutable context access - Update ngx_log_debug_http macro to use request.log() method
e649eb8 to
a15264a
Compare
Add support for asynchronous phase handlers: - Introduce async phase handler framework - Add async request handling capabilities - Implement async/await support for nginx phases - Enable non-blocking request processing
75988d4 to
090268d
Compare
Add asynchronous subrequest functionality: - Implement async subrequest handling - Add support for non-blocking subrequest operations - Enable concurrent subrequest processing - Integrate with async phase handler framework
090268d to
0317cd1
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.
Draft implementations of the following items are added to SDK: