Skip to content

feat: add RequestShaper lifecycle management#115

Closed
TheArchitectit wants to merge 2 commits intomcowger:mainfrom
TheArchitectit:feat/request-shaper-lifecycle
Closed

feat: add RequestShaper lifecycle management#115
TheArchitectit wants to merge 2 commits intomcowger:mainfrom
TheArchitectit:feat/request-shaper-lifecycle

Conversation

@TheArchitectit
Copy link
Contributor

Part 4b: Lifecycle (191 lines)

Add lifecycle methods for RequestShaper service.

Size: 191 lines ✅

Independent Security Research added 2 commits March 8, 2026 21:48
- Add type definitions: ShaperKey, QueueWaiter, QueueResult
- Add QueueFullError exception class
- Add ShaperTarget and ShaperTargetStatus interfaces
- Add ShaperStatus summary interface
- Add RequestShaper singleton class with getInstance()

Part 1 of 4: Types and Core Infrastructure for low-RPM request shaping
- Add initialize() method for service startup
- Add reload() method for config hot-reload
- Add stop() method for graceful shutdown
- Add cleanupExpiredRequests() for queue maintenance

Part 2 of 4: Lifecycle Management for low-RPM request shaping
@TheArchitectit
Copy link
Contributor Author

Code Overview

This PR implements RequestShaper lifecycle management.

Key Changes:

  1. packages/backend/src/services/request-shaper.ts - Lifecycle methods

Methods:

  • initialize(config): Bootstrap with persistence hydration
  • reload(config): Hot-reload without downtime
  • stop(): Graceful shutdown
  • cleanupExpiredRequests(): Periodic queue maintenance

Lifecycle Flow:

Testing:

  • Unit tests for lifecycle transitions
  • Config hot-reload scenarios
  • Graceful shutdown verification

@mcowger mcowger closed this Mar 13, 2026
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.

2 participants