feat(loop): add optional overlap support to allow concurrent loop executions#2765
feat(loop): add optional overlap support to allow concurrent loop executions#2765Lumabots wants to merge 10 commits intoPycord-Development:masterfrom
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. |
|
@Lumabots you should have a button here to restore the branch |
|
Succeeded by #2771 |

…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: ignorecomments were used, a comment is also left explaining why.