Jonxslays / unkey.py

An asynchronous Python SDK for unkey.dev.
https://jonxslays.github.io/unkey.py/
GNU General Public License v3.0
7 stars 1 forks source link

Fix race condition in `protected` decorator #14

Closed Jonxslays closed 5 months ago

Jonxslays commented 5 months ago

This PR fixes a race condition in the protected decorator, which was caused by using a single client, starting and then closing the session, while concurrent requests were coming in.

Removed the optionality on handler types.

Added the ability to use the client as an async context manager.

Resolves #12 Resolves #13