Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9f24136
ref(transport): Add abstract base class for worker implementation
srothh Jul 14, 2025
001f36c
ref(transport): Add _create_worker factory method to Transport
srothh Jul 14, 2025
401b1bc
ref(worker): Add flush_async method to Worker ABC
srothh Jul 17, 2025
3f43d8f
ref(worker): Move worker flush_async from Worker ABC
srothh Jul 17, 2025
15fa295
ref(worker): Amend function signature for coroutines
srothh Jul 17, 2025
ef780f3
ref(worker): Add missing docstrings to worker ABC
srothh Jul 24, 2025
f63e46f
feat(transport): Add an async task-based worker for transport
srothh Jul 17, 2025
1804271
ref(worker): Make worker work with new ABC interface
srothh Jul 17, 2025
11da869
fix(worker): Check if callbacks from worker queue are coroutines or f…
srothh Jul 17, 2025
779a0d6
ref(worker): Amend return type of submit and flush to accomodate for …
srothh Jul 17, 2025
0895d23
ref(worker): Add type parameters for AsyncWorker variables
srothh Jul 17, 2025
bbf426b
ref(worker): Remove loop upon killing worker
srothh Jul 17, 2025
744dc8a
feat(worker): Enable concurrent callbacks on async task worker
srothh Jul 18, 2025
fcc8040
fix(worker): Modify kill behaviour to mirror threaded worker
srothh Jul 18, 2025
9a43d9b
ref(worker): add proper type annotation to worker task list
srothh Jul 21, 2025
b5eda0e
ref(worker): Refactor implementation to incorporate feedback
srothh Jul 30, 2025
9e380b8
ref(worker): fix queue initialization
srothh Jul 30, 2025
ee44621
ref(worker): Add queue as optional to allow for initialisation in start
srothh Jul 30, 2025
d9f7383
ref(worker): Change to sync flush method that launches task
srothh Jul 30, 2025
d2e647b
ref(worker): Readd coroutine check for worker callbacks
srothh Jul 30, 2025
859a0e2
ref(worker): Remove sync callbacks from worker processing for now
srothh Jul 31, 2025
4a58ce7
feat(transport): Add async transport class
srothh Jul 21, 2025
cbecde7
ref(transport): Fix event loop handling in async transport
srothh Jul 22, 2025
c8bb55a
feat(transport): Add kill method for async transport
srothh Jul 22, 2025
05a7de7
ref(transport): Fix type errors in async transport
srothh Jul 23, 2025
38246d0
Add silent failing to kill on event loop errors
srothh Jul 24, 2025
8b226cb
ref(transport): Fix event loop check in make_transport
srothh Jul 24, 2025
823215e
ref(transport): Add missing transport instantiation in non-async context
srothh Jul 24, 2025
4eed4fd
ref(transport): Fix httpcore async specific request handling
srothh Jul 25, 2025
afd494d
ref(transport): Add gc safety to async kill
srothh Jul 25, 2025
fcc7ac3
ref(transport): Add missing httpcore extensions
srothh Jul 25, 2025
f659514
fix(transport): Fix fallback sync transport creating async worker
srothh Jul 28, 2025
8c542ce
ref(transport): Make kill optionally return a task for async
srothh Jul 29, 2025
30dde67
ref(transport): Adapt transport for synchronous flush interface
srothh Jul 30, 2025
3392e0e
ref(transport): Fix mypy error
srothh Jul 30, 2025
6c85500
ref(transport): Make transport loop public
srothh Jul 30, 2025
ae5a864
ref(transport): Add import checking for async transport
srothh Jul 30, 2025
9c537e6
ref(transport): Fix typing errors
srothh Jul 30, 2025
f7554b2
ref(transport): Fix import checking
srothh Jul 30, 2025
6cb72ad
ref(transport): Refactor async transport to be more aligned with sync
srothh Jul 31, 2025
9171c5d
Merge remote-tracking branch 'origin/srothh/transport-class-hierarchy…
sl0thentr0py Aug 12, 2025
111861b
ref(transport): Improve transport code quality
srothh Aug 13, 2025
4744817
ref(transport): Remove redundant background task set
srothh Aug 13, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
srothh committed Jul 28, 2025
commit 15fa295611edd059d79f2a6e0aedeb5db1707ca2
6 changes: 3 additions & 3 deletions sentry_sdk/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def kill(self) -> None:
pass

def flush(
self, timeout: float, callback: Optional[Callable[[int, float], None]] = None
self, timeout: float, callback: Optional[Callable[[int, float], Any]] = None
) -> None:
"""
Flush the worker.
Expand All @@ -50,7 +50,7 @@ def full(self) -> bool:
pass

@abstractmethod
def submit(self, callback: Callable[[], None]) -> bool:
def submit(self, callback: Callable[[], Any]) -> bool:
"""
Schedule a callback to be executed by the worker.

Expand Down Expand Up @@ -149,7 +149,7 @@ def _wait_flush(self, timeout: float, callback: Optional[Any]) -> None:
pending = self._queue.qsize() + 1
logger.error("flush timed out, dropped %s events", pending)

def submit(self, callback: Callable[[], None]) -> bool:
def submit(self, callback: Callable[[], Any]) -> bool:
self._ensure_thread()
try:
self._queue.put_nowait(callback)
Expand Down