modal-labs / synchronicity

Synchronicity lets you interoperate with asynchronous Python APIs.
Apache License 2.0
80 stars 3 forks source link

Remove Interface.ASYNC, Interface.AUTODETECT and synchronizer.create_async #169

Closed freider closed 1 week ago

freider commented 1 week ago

They have been deprecated for a long time now and before making larger changes to synchronicity it would be nice to clean up this old stuff and have tests that only test supported interfaces.

While fixing tests I noticed a couple of differences between our "new" .aio style async and the old "dedicated async type" wrappers:

async with wrapped_async_ctx_mgr:  # you don't have to use .aio here - arguably not bad
    ...

with wrapped_async_ctx_mgr.aio():  # you can use sync interface of the context manager returned by .aio here 🤦 works but stupid!
    ...

This is btw just removing the obvious stuff - there is probably a lot of code that can be simplified because of the interface removals, since there is now only a single interface for output types