Skip to content

Conversation

@ensh63
Copy link
Contributor

@ensh63 ensh63 commented Jan 9, 2026

Draft implementations of the following items are added to SDK:

  • asynchronous phase handler;
  • asynchronous subrequest;
  • type-safe request context;
  • typed storage for Pool.

Copy link

Copilot AI left a 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 AsyncHandler trait and supporting infrastructure for asynchronous HTTP request handling
  • Adds RequestContext trait for type-safe request-specific context data management
  • Implements TypeStorage trait for storing typed values in nginx memory pools
  • Refactors existing examples to use new HttpRequestHandler trait and add_phase_handler function

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant