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

on Windows, Limiter() constructor hangs after gevent monkeypatch #167

Open
gonewest818 opened this issue Mar 22, 2024 · 2 comments
Open

Comments

@gonewest818
Copy link

As the subject says, specifically on Windows this hangs indefinitely:

import gevent.monkey
gevent.monkey.patch_all()

from pyrate_limiter import Duration, Rate, Limiter

rate = Rate(5, Duration.SECOND * 2)
limiter = Limiter(rate)

Reproduced on Windows 11, using pyenv to install python 3.10, 3.11 and 3.12.

@vutran1710
Copy link
Owner

Were you trying to unit-test the limiter or something?
What version were you using?
And Limiter only accepts a list of rates, not a single rate like in your example.

@gonewest818
Copy link
Author

gonewest818 commented Mar 22, 2024

No, this is the smallest repro of what I'm seeing in a larger system. I narrowed it down to literally the QuickStart example on your README except with the monkeypatching inserted first.

Oh, sorry, your other questions:

  • not a unit test
  • does not seem to matter if I pass Limiter a list of rates or a single rate
  • version 3.6.0

I also cut down the python virtual environment to the bare minimum, it's literally just

Package        Version
-------------- -------
cffi           1.16.0
gevent         24.2.1
greenlet       3.0.3
pip            24.0
pycparser      2.21
pyrate-limiter 3.6.0
setuptools     69.2.0
zope.event     5.0
zope.interface 6.2

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

No branches or pull requests

2 participants