Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pilot implementation for Realtime event based API's - ConnectionStateChange #6

Merged
merged 35 commits into from
Jun 20, 2020

Conversation

tiholic
Copy link
Contributor

@tiholic tiholic commented May 3, 2020

Realtime events workflow based on Streams handled for both Android and iOS.

Using StreamChannel, which is based on EventChannel

  • StreamsChannel (EventChannel) is setup on both Android and iOS
  • ConnectionStateChange is fully supported
  • Better way to handle codecs using CodecPair<Type>(encoder, decoder)
    • Supported only on Dart and Android side.
    • Objective C has separate reader and writer implementations.

Known Issues - Applies only for Event Streams:

  • Hot-Restart will not dispose of platform side objects
    • This is a concern only for development phase
  • In production, the behavior is as below:
    • On minimising the app (background) - instances stay intact (dart side will be perfectly connected to platform side)
    • On killing the app - all instances will be created afresh and linked as expected

NOTE: A fix for the above issue is an experimental WIP, and changes related to the same is not available in the repo.

@tiholic tiholic changed the base branch from master to feature/platform-message-encoding May 4, 2020 08:03
@QuintinWillison QuintinWillison mentioned this pull request May 4, 2020
@tiholic tiholic force-pushed the feature/platform-message-encoding branch from 0c862fe to c11e35d Compare May 5, 2020 17:06
Copy link
Member

@mattheworiordan mattheworiordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good.

Any chance you could help me run this locally and test with some instructions? Perhaps in the example README?

Also, as requested in other PRs, it would be great to see the Dart IDL README include docs as you go along, in line with the other SDKs.

Copy link
Contributor

@QuintinWillison QuintinWillison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a first round of comments but I need to go for a few hours so wanted to get these in front of you @tiholic so discussion can start. I'll be back later on to contribute further.

pubspec.yaml Show resolved Hide resolved
example/lib/main.dart Outdated Show resolved Hide resolved
example/lib/main.dart Outdated Show resolved Hide resolved
ios/Classes/codec/AblyFlutterReader.h Show resolved Hide resolved
ios/Classes/AblyFlutterStreamHandler.h Outdated Show resolved Hide resolved
@QuintinWillison
Copy link
Contributor

You need to rebase your commits against the target branch as there are conflicts which may be making review harder. Thanks!

@tiholic tiholic force-pushed the feature/realtime-pilot branch 2 times, most recently from 7e01bd4 to 6f8c575 Compare May 6, 2020 19:49
@tiholic
Copy link
Contributor Author

tiholic commented May 6, 2020

@QuintinWillison rebase complete

tiholic pushed a commit that referenced this pull request May 7, 2020
- _Nullable to nullable
- making sure argument name placeholder and selector signature are in sync

#6 (comment)
@tiholic tiholic changed the base branch from feature/platform-message-encoding to master May 13, 2020 17:04
Rohit R. Abbadi added 12 commits May 14, 2020 02:52
- `.fromKey` and `.fromOptions` are removed from high level interface
#2 (comment)

- Getting rid of XXXBase and XXX as it is only required for ably-java
 since it supports plain java and android
#2 (comment)
- Getting rid of XXXBase and XXX as it is only required for ably-java (since it supports plain java and android)
#2 (comment)
- adding new streams_channel dependency for handling multiple streams
- reverting old dev dependency versions due to pub get conflict
Rohit R. Abbadi added 3 commits May 14, 2020 02:52
- _Nullable to nullable
- making sure argument name placeholder and selector signature are in sync

#6 (comment)
@tiholic tiholic force-pushed the feature/realtime-pilot branch from 1542ced to 3027da0 Compare May 13, 2020 21:22
Rohit R. Abbadi added 3 commits May 15, 2020 10:19
- improvise example for nested listener creation and cancellation
- A new test to understand how nested stream cancellations based on the order in which subscriptions are created
@tiholic
Copy link
Contributor Author

tiholic commented May 16, 2020

@mattheworiordan @QuintinWillison

Updated README with "how to run example" and "API usage"

9f9a3f8

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@mattheworiordan mattheworiordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not clear why we have designed the API in a way that deviates so significantly from all other SDKs. See https://www.ably.io/documentation/quick-start-guide and choose different languages to see. We have very good consistency across the board, yet Dart has deviated significantly with a new plugin object, and all static object types exposed at the root level (i.e. Ably. in an IDE will surface every object type now).

Can you explain why the API is presented in this way?
What decision was made that justified deviating from the norm?

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
@mattheworiordan
Copy link
Member

Ok re separate PR to address comments. Looking forward to seeing an API that follows the Ably IDL.

remove env from README
tiholic added 2 commits June 19, 2020 12:09
Shedding light on RTE6a drawback and suggestion on overcoming that from SDK users end
Copy link
Contributor

@QuintinWillison QuintinWillison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we've deliberated over this particular PR long enough already. We understand the constraints and it delivers the functionality required in a Dart (/ Flutter) idiomatic manner. Let's get it merged and move this repository forward!

@tiholic tiholic dismissed mattheworiordan’s stale review June 20, 2020 09:43

Will be addressing in a separate PR ( #15 )

@tiholic tiholic merged commit 683a6e0 into master Jun 20, 2020
tiholic pushed a commit that referenced this pull request Jun 20, 2020
- _Nullable to nullable
- making sure argument name placeholder and selector signature are in sync

#6 (comment)
@tiholic tiholic deleted the feature/realtime-pilot branch June 20, 2020 09:43
QuintinWillison added a commit that referenced this pull request Mar 19, 2021
Hoping to solve this error in workflow environment:

Unhandled exception:
Invalid argument (uri): Unknown package: Instance of '_SimpleUri'
#0      _resolveUri.<anonymous closure> (package:dartdoc/src/generator/resource_loader.dart:34:9)
#1      _RootZone.runUnary (dart:async/zone.dart:1612:54)
#2      _FutureListener.handleValue (dart:async/future_impl.dart:152:18)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:704:45)
#4      Future._propagateToListeners (dart:async/future_impl.dart:733:32)
#5      Future._completeWithValue (dart:async/future_impl.dart:539:5)
#6      Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:577:7)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)
#10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)
Error: Process completed with exit code 255.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants