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

Don't pickle coroutine state twice #148

Closed chriso closed 7 months ago

chriso commented 7 months ago

Coroutine state is currently pickled twice, here and here. This PR fixes the issue by requiring that coroutine state is bytes when it reaches the latter. This allows the bundled scheduler to be responsible for serializing the state, where it can check that the state is valid and raise an IncompatibleStateError otherwise.