🏛️ Stateless C++ Services
Home Chapters Examples Diagrams Bibliography GitHub ↗
  1. Home
  2. Request-Scope Discipline
Part 2 2 chapters

Request-Scope Discipline

RAII as the mechanism that makes request scope concrete, and PMR's monotonic_buffer_resource as its in-language realization — how per-request state is bound to a scope and released all at once.

Doc 2

RAII as the foundation for safe stateful work

The mechanism that makes request scope concrete. The RequestContext pattern, the three exception-safety guarantees, the gRPC callback API as the request boundary, the common mistakes (throwing destructors, raw pointers, locks across co_await), and the performance side of construction and destruction in hot paths.

Read →
Doc 3

PMR's monotonic_buffer_resource as architectural statelessness

PMR as the in-language realization of "request brings its own memory, all releases together." The request arena RAII pattern, the canonical layered monotonic + unsynchronized_pool recipe, container-type choices, the lifetime trap counterexample, C++23 additions.

Read →
← Previous part Deployment Posture Next part → Process-Scope Discipline
Stateless C++ Services
Tutorial content: CC BY 4.0. Sample code: Apache 2.0.
Source on GitHub ↗  ·  File an issue ↗