Skip to content

Commit

Permalink
Updated UPDATING.md doc, deprecated sync API
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Oct 1, 2023
1 parent fac554a commit 94b319d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down

0 comments on commit 94b319d

Please sign in to comment.