Skip to content

Commit 5abf356

Browse files
committed
ref(transport): Add flush_async in the Transport abc
Add a new flush_async method in the Transport ABC. This is needed for the async transport, as calling it from the client while preserving execution order in close will require flush to be a coroutine, not a function. GH-4568
1 parent fe27100 commit 5abf356

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sentry_sdk/transport.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ def flush(
107107
"""
108108
return None
109109

110+
async def flush_async(
111+
self: Self,
112+
timeout: float,
113+
callback: Optional[Any] = None,
114+
) -> None:
115+
"""
116+
Send out current events within `timeout` seconds. This method needs to be awaited for blocking behavior.
117+
118+
The default implementation is a no-op, since this method may only be relevant to some transports.
119+
Subclasses should override this method if necessary.
120+
"""
121+
return None
122+
110123
def kill(self: Self) -> None:
111124
"""
112125
Forcefully kills the transport.

0 commit comments

Comments
 (0)