centrifugal / centrifuge-dart

Dart (Flutter) client SDK for bidirectional communication with Centrifugo and Centrifuge-based server over WebSocket
https://pub.dartlang.org/packages/centrifuge
MIT License
113 stars 34 forks source link

Client improvements: initial disconnect, futures for methods, error stream #57

Closed FZambia closed 3 years ago

FZambia commented 3 years ago

Next iteration of improvements here:

  1. Return Futures from connect, disconnect, subscribe, unsubscribe - addresses #31
  2. On initial connect fire DisconnectEvent on connection error - this makes behavior of centrifuge-dart similar to all other our clients - addresses #56
  3. Add client error stream to consume ErrorEvent - each transport failure will emit error to this stream - addresses #56
  4. Refactor subscription statuses - add subscribing and error statuses
  5. Do not call UnsubscribeEvent if subscription not successfully subscribed (in subscribed state).
  6. Update disconnect reasons due to failed connection and calling Client.Disconnect method - make it more similar to all other connector libraries in ecosystem
  7. Improve/fix examples
  8. Add default transport timeout (10 sec) – on connect and subscribe timeouts client will auto reconnect, calls like publish, history, rpc can now throw TimeoutException. Also - properly pass timeout to the transport (was not before!). Again – this makes client behave similarly to all other connectors.
  9. Add presence and presenceStats methods for Subscription and on client top level (for server-side subs).
  10. Support streamPosition in SubscribeSuccessEvent
  11. Support streamPosition in ServerSubscribeEvent
  12. Support data in ServerSubscribeEvent
  13. Implement send method to send async messages to a server
  14. Fix deletion during iteration over map when working with server-side subscriptions
  15. Better event String representations
  16. Trigger unsubscribe event when unsubscribe called in disconnected state.