Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify try_acquire method #245

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

JoaquinPolonuer
Copy link

No description provided.

@JoaquinPolonuer JoaquinPolonuer changed the title Refactor try acquire Simplify try_acquire method Feb 24, 2025
@JoaquinPolonuer
Copy link
Author

JoaquinPolonuer commented Feb 24, 2025

Moved this here from llmclient library. Will implement tests to check if try_acquire works as expected.

Copy link
Collaborator

@jamesbraza jamesbraza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, LGTM

with pytest.raises(TimeoutError):
await GLOBAL_LIMITER.try_acquire(("get", "test"), acquire_timeout=2)

# Then we pass an impossible limit, but with a timeour high enough to succeed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Then we pass an impossible limit, but with a timeour high enough to succeed
# Then we pass an impossible limit, but with a timeout high enough to succeed

Re-reading this, I just noticed a typo

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fun I made codespell-project/codespell#3656 for this, lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants