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
{{ message }}
This repository was archived by the owner on Mar 20, 2019. It is now read-only.
I'm wondering what would be the best way to work around the ValueError from the link below if the todo_list say, has a single task. I know that's not really the point behind it (as error says), but just say you want to reuse the code you've written (that uses throuttler.run() inside the loop) to work for several tasks and now want to call it with a single task. What would you do, since you can't just provide per_time_window=len(todo_list)-1 since that'd be 0 -- that was the workaround I had when I supplied less than 100 tasks which is the default time window.
raiseValueError(("per_time_window should be less than the length "
"of todo_list. Not see much point in throttling "
"if there's no actual throttling."))
To offer more details, the task provided to the throttler also raises ThrottleException to get re-enqueued, so I wouldn't want to just add that Future in the event loop without it being wrapped in a Throttler(...).run() call since it wouldn't know what to do with the ThrottleException.
Hi,
Thanks for the cool library!
I'm wondering what would be the best way to work around the
ValueErrorfrom the link below if thetodo_listsay, has a single task. I know that's not really the point behind it (as error says), but just say you want to reuse the code you've written (that uses throuttler.run() inside the loop) to work for several tasks and now want to call it with a single task. What would you do, since you can't just provideper_time_window=len(todo_list)-1since that'd be 0 -- that was the workaround I had when I supplied less than 100 tasks which is the default time window.asyncio-throttler/asyncio_throttler/throttle.py
Lines 66 to 71 in 16ffa6f
To offer more details, the task provided to the throttler also raises
ThrottleExceptionto get re-enqueued, so I wouldn't want to just add thatFuturein the event loop without it being wrapped in aThrottler(...).run()call since it wouldn't know what to do with theThrottleException.Thanks!