fermilink.runner.admission module¶
- exception fermilink.runner.admission.QueueFullError[source]¶
Bases:
RuntimeErrorRaised when the pending-run admission queue is full.
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class fermilink.runner.admission.RunAdmissionController[source]¶
Bases:
objectIn-memory admission queue for global/per-user run concurrency limits.
- __init__(*, global_limit, per_user_limit, max_queue_size=0, max_pending_per_user=0)[source]¶
- Parameters:
global_limit (int)
per_user_limit (int)
max_queue_size (int)
max_pending_per_user (int)
- Return type:
None
- async acquire(user_key)[source]¶
Acquire admission for a run, queueing when limits are saturated.
- Parameters:
user_key (str | None)
- Return type:
dict[str, int | bool]
- async release(user_key)[source]¶
Release one active slot and admit queued work if possible.
- Parameters:
user_key (str | None)
- Return type:
None