Skip to main content

rate_limit

Tell worker(s) to modify the rate limit for a task by type.

def rate_limit(
state: object,
task_name: string,
rate_limit: string
) - > dict

Tell worker(s) to modify the rate limit for a task by type.

Parameters

NameTypeDescription
stateobjectThe current worker state object containing the application instance and consumer.
task_namestringThe registered name of the task type to update the rate limit for.
rate_limitstringThe new rate limit value, expressed as a frequency string (e.g., '5/s', '10/m') or an integer.

Returns

TypeDescription
dictA dictionary containing the status of the operation (ok or nok) and a descriptive message.