RequestCtx — Aquilia Documentation
Comprehensive guide and documentation for RequestCtx in the Aquilia framework. View API reference, examples, and implementation patterns.
RequestCtx aquilia.controller.base.RequestCtx — Request context object The RequestCtx class encapsulates the request lifecycle, providing access to the current request, user identity, session state, DI container, and mutable state dict. Class Definition & slots For maximum performance, RequestCtx is optimized using Python __slots__, yielding up to 40% faster attribute access: Escape Hatch: If middleware or extensions need to set dynamic attributes, RequestCtx intercepts those calls via custom __getattr__ and __setattr__ methods, storing them inside the _extra dictionary safely. RequestCtx Object Pool To avoid heap allocation overhead during high-concurrency requests, Aquilia uses a lock-free _RequestCtxPool. Used internally by the engine to acquire and release contexts, resetting fields in-place: Delegated Properties & Methods For convenience, RequestCtx exposes properties that forward directly to the underlying Request object: Attribute Type Description ))} Route Decorators ControllerFactory )
Go to Homepage