Skip to content

Consider switching from AsyncSequence to callbacks for state changes #259

@lawrence-forooghian

Description

@lawrence-forooghian

Summary: remove or demote our use of AsyncSequence

Split from #232. So that when you receive a state callback, inside the callback you can be sure that the object that changed state is in the state that update tells you it changed to (you don't have this guarantee with AsyncSequence because the iteration is performed asynchronously). And for consistency I think that we should also do it for non-state things e.g. messages, reactions, typing.

The work here would be:

  • change the subscription / event listening API to match that of JS (i.e. accept a listener, return a subscription object that has a method that allows you to unsubscribe) — at time of writing, the correct API to copy is that from Integration/single channel integration ably-chat-js#521
  • test the currently-@specUntested spec points that refer to being able to unsubscribe
  • update the SDK's internals to not use AsyncSequence
  • update example app to use this new API
  • update ably.com docs

I think we should also:

Notes:

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

Labels

breakingBackwards incompatible changes made to the public API.enhancementNew feature or improved functionality.pre-v1Decisions to be made before releasing 1.0.0.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions