dispatchrun / dispatch-py

Python package to develop applications with Dispatch.
https://pypi.org/project/dispatch-py/
Apache License 2.0
54 stars 3 forks source link

add special Reset class to implement tail calls #145

Closed achille-roussel closed 5 months ago

achille-roussel commented 5 months ago

This PR adds a new Reset type which is intended to be used to allow resetting the current coroutine execution to a different pair of function and arguments.

In the inner layers of the SDK, this construct gets turned into a tail call with a temporary error status to communicate the failure to the scheduler (and apply back-pressure) while also changing the input arguments.