Synchronicity - how to ship both sync and async APIs
Authors of many Python packages, in particular those that perform network operations, want to write async Python for the convenient and performant concurrency model it provides.
For your users' benefit you may still want to ship both sync and async variants of your API.
In this talk, we walk through some strategies we've developed at Modal for how to manage release of such dual APIs, including:
- Automating API translation using the
synchronicityopen source package - Managing a dedicated event loop
- An opinionated
.aio()async API syntax - Advanced usage of the Python type system to make all of this type safe
- Speculation on the future: codegen or ai-gen in the release process?
TBD
Elias Freider
Elias works as a member of technical staff at Modal (https://modal.com/) where he focuses on making dev tools that sparks of joy.
Original co-author of the Luigi workflow orchestration engine, and many other internal tools for data teams over the years.