| Name | Type | Description |
|---|---|---|
fn* | _AssignHandlerT | The assign handler function |
Register the function that assigns a thread's priority settings.
The function receives a PriorityContext and returns PrioritySettings,
or None for the defaults.
Example:
@priority.assign
async def assign(ctx: PriorityContext) -> PrioritySettings | None:
if ctx.cron_id is not None:
return {"priority": -2}
return None