Skip to content

Commit

Permalink
fix liniting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
semiversus committed May 3, 2021
1 parent 449a0c1 commit 7e5253c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion broqer/op/throttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def _delayed_emit_cb(self, value=NONE):

self._timer.start(self._duration)


def reset(self):
""" Reseting duration for throttling """
self._timer.cancel()
Expand Down
7 changes: 3 additions & 4 deletions broqer/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class Timer:
def __init__(self, callback: Optional[Callable[[], None]] = None,
loop: Optional[asyncio.BaseEventLoop] = None):
self._callback = callback
self._handle = None # type: asyncio.Handle
self._handle = None # type: Optional[asyncio.Handle]
self._loop = loop or asyncio.get_event_loop()
self._args = None

def start(self, timeout: float, args=()) -> None:
""" start the timer with given timeout. Optional arguments for the
callback can be provided. When the timer is currently running, the timer
will be re-set to the new timeout.
callback can be provided. When the timer is currently running, the
timer will be re-set to the new timeout.
:param timeout: time in seconds to the end of the timer
:param args: optional tuple with arguments for the callback
Expand Down Expand Up @@ -68,4 +68,3 @@ def _trigger(self):
self._handle = None
if self._callback:
self._callback(*self._args)

0 comments on commit 7e5253c

Please sign in to comment.