Discover devices in parallel instead of serially waiting for each device type#51015
Merged
jmagman merged 1 commit intoflutter:masterfrom Feb 20, 2020
Merged
Discover devices in parallel instead of serially waiting for each device type#51015jmagman merged 1 commit intoflutter:masterfrom
jmagman merged 1 commit intoflutter:masterfrom
Conversation
jmagman
commented
Feb 19, 2020
| yield device; | ||
| } | ||
| } | ||
| Future<List<Device>> getAllConnectedDevices() async { |
Member
Author
There was a problem hiding this comment.
@zanderso in #49854 (comment):
This could return a
Streamif we're actually getting results bit-by-bit [...] or if this is implementing an interface that requires it to be aStream, but otherwise we should probably preferFuture<List>, orFuture<Iterable>.(
async*Streams also can have some surprising behavior. IIRC they don't interact well withFakeAsyncfor tests.)
Contributor
|
This change looks good to me, but it will likely require a corresponding update in the google3 tool- I can point you at the sources tomorrow. |
christopherfujino
approved these changes
Feb 19, 2020
Contributor
christopherfujino
left a comment
There was a problem hiding this comment.
This is great, LGTM
Member
Author
|
Kicking cocoon, landing on red. |
This was referenced May 29, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
For the next part of wireless iOS device support, make all the
DeviceDiscovery.devicescalls run at the same time in aFuture.wait<List<Device>>(). This is necessary so the network device timeouts (to be introduced in the next PR) increase the time linearly instead of exponentially.Breaking out just this change to make the next PR smaller, and changing the Stream=>List return value in the signature created some churn.
Related Issues
Another piece of #15072.
Tests
Updated tests to use lists instead of streams.
Checklist
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change