Skip to content

Commit 2896602

Browse files
committed
ref(worker): Amend function signature for coroutines
Coroutines have a return value, however the current function signature for the worker methods does not accomodate for this. Therefore, this signature was changed. GH-4578
1 parent 7d9f91e commit 2896602

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentry_sdk/worker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def kill(self) -> None:
3434
pass
3535

3636
def flush(
37-
self, timeout: float, callback: Optional[Callable[[int, float], None]] = None
37+
self, timeout: float, callback: Optional[Callable[[int, float], Any]] = None
3838
) -> None:
3939
"""
4040
Flush the worker.
@@ -50,7 +50,7 @@ def full(self) -> bool:
5050
pass
5151

5252
@abstractmethod
53-
def submit(self, callback: Callable[[], None]) -> bool:
53+
def submit(self, callback: Callable[[], Any]) -> bool:
5454
"""
5555
Schedule a callback to be executed by the worker.
5656
@@ -149,7 +149,7 @@ def _wait_flush(self, timeout: float, callback: Optional[Any]) -> None:
149149
pending = self._queue.qsize() + 1
150150
logger.error("flush timed out, dropped %s events", pending)
151151

152-
def submit(self, callback: Callable[[], None]) -> bool:
152+
def submit(self, callback: Callable[[], Any]) -> bool:
153153
self._ensure_thread()
154154
try:
155155
self._queue.put_nowait(callback)

0 commit comments

Comments
 (0)