Add "get_workers" method to "QuotaDriverAPI" class

This method returns the quota driver workers that needs to be spawned
during the plugin initialization.

Change-Id: Id9840912b9d0018d008b6961d24dadbfaafc9f8e
Related-Bug: #1954662
This commit is contained in:
Rodolfo Alonso Hernandez 2022-01-16 13:09:52 +00:00
parent 76b9a09591
commit 04a87664c2
2 changed files with 19 additions and 0 deletions

View File

@ -167,3 +167,16 @@ class QuotaDriverAPI(object, metaclass=abc.ABCMeta):
:return: None if passed; ``OverQuota`` if quota limits are exceeded,
``InvalidQuotaValue`` if delta values are invalid.
"""
@staticmethod
@abc.abstractmethod
def get_workers():
"""Return the quota driver workers to be spawned during initialization
This method returns the quota driver workers that needs to be spawned
during the plugin initialization. For example, ``DbQuotaNoLockDriver``
requires a ``PeriodicWorker`` to clean up the expired reservations left
in the database.
:return: list of ``worker.BaseWorker`` or derived instances.
"""

View File

@ -0,0 +1,6 @@
---
other:
- |
Added abstract method ``get_workers`` to ``QuotaDriverAPI`` metaclass. This
method returns the quota driver workers that needs to be spawned during the
plugin initialization.