dispatchrun / dispatch-py

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

@dispatch.coroutine #40

Closed chriso closed 9 months ago

chriso commented 9 months ago

This PR introduces an experimental @dispatch.coroutine decorator that compiles the provided function into a durable coroutine (https://github.com/stealthrocket/dispatch-sdk-python/pull/11).

The coroutine is able to use inline directives such as poll and exit. The coroutine will be suspended at these points and control will yield to the orchestrator. In the case of poll, the coroutine will be resumed when at least one call result is available.