The guarded function. May return a promise (async gate) or any other value (sync gate with trailing lockout only).
Optionaloptions: SingleFlightOptionsA function with the same parameters that either passes through the
handler's return value or returns undefined when the call was suppressed.
"In flight" means: the previous call's returned promise is still pending,
OR the previous call settled (or ran synchronously) less than lockoutMs
ago. Suppressed calls return undefined without invoking the handler.
A rejected promise releases the gate like a resolved one and keeps its
rejection semantics (the wrapped return value is passed through, so callers
that void it today behave exactly as before).
Wraps a handler so re-entrant calls are dropped while a previous invocation is in flight.