jztools.general#
Classes
|
Ensures that a callable is executed only if a given delay has elapsed since the last call. |
Exceptions
|
- exception jztools.general.NotSingleEntry(num_entries)#
Bases:
Exception
- class jztools.general.Debouncer(delay: float)#
Bases:
objectEnsures that a callable is executed only if a given delay has elapsed since the last call.
from jztools.general import Debouncer def fxn(): print('Executed') debouncer = Debouncer(5) debouncer.call(fxn) debouncer.call(fxn)
Executed
- Parameters:
delay – Seconds to wait before permitting the next execution.
- __call__(fxn: Callable)#
Call self as a function.