-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Added a DartExecutor API for querying # of pending channel callbacks #10021
Conversation
cc @tvolkert |
/** | ||
* Returns the number of pending platform channel callback replies. | ||
*/ | ||
public int getNumOfPendingChannelCallbacks() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we call these methods getPendingChannelResponseCount()
? Generally in Flutter we avoid truncating terms, and also it might be clearer to refer to them as "responses" because they are responding to messages.
Also, in the javadocs can you elaborate on what this means? Currently the javadoc repeats the terms in the name of the method. If a developer doesn't already know what the method represents, then that developer would probably like to know that:
- every channel message from Android to Flutter will receive a response, even if its empty
- Flutter tracks the number of responses its waiting for
- this method returns that number
- this method is useful for determining whether or not Flutter is idle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. PTAL.
shell/platform/android/io/flutter/embedding/engine/dart/DartExecutor.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/dart/DartExecutor.java
Outdated
Show resolved
Hide resolved
* possibly capture an indeterministic internal state, and is strongly discouraged. | ||
* | ||
* <p>Currently, it's mainly useful for a testing framework like Espresso to determine whether all | ||
* the async channel callbacks are properly handled and the app is idle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, does this ensure they are "properly handled"? or just that it's idle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed "properly". I feel it's too vague to simply say "it's idle", because usually it doesn't equal completely idle. Rather, it's a state we define as idle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending a few more adjustments. Thanks.
Checked the failing tests, and it doesn't seem relevant to this PR. I'm going to ignore them and submit the code. |
flutter/engine@8ed5da8...ef99738 git log 8ed5da8..ef99738 --no-merges --oneline ef99738 Added a DartExecutor API for querying # of pending channel callbacks (flutter/engine#10021) a0ec528 Embedding testing app (flutter/engine#10007) 2bf1506 Disable DartLifecycleTest::ShuttingDownTheVMShutsDownAllIsolates in runtime_unittests. (flutter/engine#10064) 8edd257 Roll fuchsia/sdk/core/linux-amd64 from M5an7VPM8DiCcNcKe6J0CkAtLk8X9oMeJUqGOrZATIsC to XqtWTBni4xpYCTr7gqU7rFTuXNY1TZ_zOqBJrZM8c_kC (flutter/engine#10061) e32bdf5 Roll src/third_party/skia 00c680d2bb7c..e11dfd3da4d7 (18 commits) (flutter/engine#10062) 6603dbd Update .cirrus.yml (flutter/engine#10056) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
flutter/engine@8ed5da8...ef99738 git log 8ed5da8..ef99738 --no-merges --oneline ef99738 Added a DartExecutor API for querying # of pending channel callbacks (flutter/engine#10021) a0ec528 Embedding testing app (flutter/engine#10007) 2bf1506 Disable DartLifecycleTest::ShuttingDownTheVMShutsDownAllIsolates in runtime_unittests. (flutter/engine#10064) 8edd257 Roll fuchsia/sdk/core/linux-amd64 from M5an7VPM8DiCcNcKe6J0CkAtLk8X9oMeJUqGOrZATIsC to XqtWTBni4xpYCTr7gqU7rFTuXNY1TZ_zOqBJrZM8c_kC (flutter/engine#10061) e32bdf5 Roll src/third_party/skia 00c680d2bb7c..e11dfd3da4d7 (18 commits) (flutter/engine#10062) 6603dbd Update .cirrus.yml (flutter/engine#10056) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
This API will be used for monitoring the # of pending callbacks that shall be invoked by the platform in Espresso.
Relevant PR for monitoring the Dart land: flutter/flutter#36599.