Prehandler
Prehandler is a term used in software architecture to describe a function or component that runs before the main request handler in a processing pipeline. It typically lives in middleware stacks, API gateways, or event-driven systems, and its job is to perform early processing on an incoming request or message.
A prehandler may validate input, authenticate and authorize the caller, enforce rate limits, normalize data, attach
Implementation and behavior: A prehandler receives the same context as the main handler, can modify the request,
Design considerations: Order of prehandlers matters; failures should be clearly communicated; avoid expensive I/O; ensure security;