-
Notifications
You must be signed in to change notification settings - Fork 18
Add pull method to ExclusiveRemoteTask #1027
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
Conversation
|
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use recursion with an unbounded depth this is very bad practice.
src/bloqade/analog/task/exclusive.py
Outdated
self._task_result_ir = self._http_handler.fetch_results(self._task_id) | ||
else: | ||
time.sleep(poll_interval) | ||
self.pull(poll_interval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do this with a loop do not use recursion for with an unknown depth of the call stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I was wondering about this. I thought it would be okay because of the slow poll time
Add a
pull
method toExclusiveRemoteTask
. The same asfetch
except recursive after atime.sleep
with a poll time of 10 seconds.