[docs]classNoopController(RateController):"""Rate controller that accepts all requests and does nothing."""_instance:ClassVar['NoopController']
[docs]def__new__(cls,*_:Any,**kwargs:Any)->'NoopController':""" Positional arguments, accepted for consistency with other rate controllers, are ignored. Keyword arguments are passed to the super class constructor. Note: Implementation detail: The ``__new__`` method returns a singleton instance, for better memory management. """try:returncls._instanceexceptAttributeError:cls._instance=super().__new__(cls,**kwargs)returncls._instance
[docs]@override@asynccontextmanagerasyncdefrequest(self,tokens:float=1,**_:Any)->AsyncIterator[None]:"""Asynchronous context manager that does nothing else than yield."""yield