Drain Requested • AI Agent SDK
drain_requested: Return whether “marker“ is a live drain request for this instance.
drain_requested
Method
</div>
This is a method of the DrainMarkerPolicy class in the protocols module.
Return whether `marker` is a live drain request for this instance.
Signature
def drain_requested(marker: Optional[Dict[str, Any]], current_epoch: str, now: float) -> boolParameters
ParamField
OptionalParsed marker contents, or `None` when no marker file is present.
ParamField
strThe current instantiation epoch (see :func:current_epoch).
ParamField
floatA monotonic timestamp (unused by the default policy; accepted so subclasses can implement TTL/debounce without changing the call site).
Returns
ResponseField
bool`True` only for a non-stale, current-epoch drain request that has not already been handled.
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 5668