You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PR #40 , native cancellation support was added to the TypeScript package (smooth-api-ts) allowing users to pass an AbortSignal to cancel requests and interrupt backoff delays immediately.
To maintain feature parity as defined in our Contributing guidelines, we need to implement equivalent cancellation behavior in the Python package (smooth-api-py).
Acceptance Criteria
Implement a mechanism to cancel requests and interrupt backoff delays in Python. (The idiomatic approach is usually properly handling asyncio.CancelledError when the wrapping task is cancelled, or accepting an asyncio.Event as a cancellation token).
Ensure that cancelling a request immediately breaks out of the retry loop and doesn't just trigger another retry.
Add unit tests verifying cancellation during the backoff sleep phase and pre-aborted states.
Update packages/smooth-api-py/README.md with usage examples.
Description
In PR #40 , native cancellation support was added to the TypeScript package (
smooth-api-ts) allowing users to pass anAbortSignalto cancel requests and interrupt backoff delays immediately.To maintain feature parity as defined in our Contributing guidelines, we need to implement equivalent cancellation behavior in the Python package (
smooth-api-py).Acceptance Criteria
asyncio.CancelledErrorwhen the wrapping task is cancelled, or accepting anasyncio.Eventas a cancellation token).packages/smooth-api-py/README.mdwith usage examples.Additional Context
AbortController. The implementation should feel native to Pythonasynciopatterns.