From 94b319d563e9883ed529f78ef55b85851ad012ea Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Sun, 1 Oct 2023 19:47:54 +0530 Subject: [PATCH] Updated UPDATING.md doc, deprecated sync API --- UPDATING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/UPDATING.md b/UPDATING.md index b30a7f94..01308642 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -72,6 +72,7 @@ These include: - Deprecation of support for Python versions 3.4, 3.5 and 3.6 - New, asynchronous API + - Deprecated synchronous API ### Deprecation of Python 3.4, 3.5 and 3.6 @@ -85,6 +86,23 @@ To see which versions of Python we test the SDK against, please look at our The 1.2.0 version introduces a breaking change, which changes the way of interacting with the SDK from synchronous to asynchronous, using [the `asyncio` foundational library](https://docs.python.org/3.7/library/asyncio.html) to provide support for `async`/`await` syntax. Because of this breaking change, every call that interacts with the Ably REST API must be refactored to this asynchronous way. +Important Update - +- If you want to keep using old synchronous style API, make sure to set `sync_enabled` property of `AblyRest` client. +- This is applicable for all new Ably REST async APIs. + +```python +from ably import AblyRest + +def main(): + ably = AblyRest('api:key') + ably.sync_enabled = True + channel = ably.channels.get("channel_name") + channel.publish('event', 'message') + +if __name__ == "__main__": + main() +``` + #### Publishing Messages This old style, synchronous example: