-
-
Notifications
You must be signed in to change notification settings - Fork 472
feat(loop): add optional overlap support to allow concurrent loop executions #2765
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
base: master
Are you sure you want to change the base?
Conversation
…xecutions Added a new overlap parameter to the loop decorator and Loop class to control whether loop iterations can run concurrently. When set to True, the next iteration will not wait for the previous one to finish, allowing overlapping executions—useful for long-running tasks that should not delay subsequent runs. Defaults to False to preserve current behavior. Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Testing needed, also shouldn't a reference to the task be stored somewhere? An easy way is to have a set storing them and binding the task completion to set.remove |
…t: 'overlap' Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
i did test it and everything seems to works fine, but i dont really know why we would store it since the old self.coro was not stored either |
well the cancel does not end the create tasks, i'll fix that |
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Exception in callback Future.set_result(True) handle: <TimerHandle when=203424.768941542 Future.set_result(True)> Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/events.py", line 84, in _run self._context.run(self._callback, *self._args) asyncio.exceptions.InvalidStateError: invalid state Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
ready for review, did lot of testing and everything seems to works.
|
Could you add documentation to Overall good addition, but I think it needs a bit more polishing. |
…xecutions
Added a new overlap parameter to the loop decorator and Loop class to control whether loop iterations can run concurrently. When set to True, the next iteration will not wait for the previous one to finish, allowing overlapping executions—useful for long-running tasks that should not delay subsequent runs. Defaults to False to preserve current behavior.
Summary
Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.