Added IOWebSocketChannel.ready field and timeout parameter - #85
Added IOWebSocketChannel.ready field and timeout parameter#85KammererTob wants to merge 9 commits into
Conversation
'ready' future indicates if the connection has been established. It completes on successful connection to the websocket.
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
@googlebot I consent. |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
|
@KammererTob I have consented although I think you need to make sure the email address which you used for a commit is added to your account here: https://github.com/settings/emails since it does not recognize those commits as yours at the moment. |
|
@googlebot I fixed it. |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
@artrmz Thanks for the hint! |
|
Hi @natebosch and @jacob314, do you mind taking a look at this PR? Thanks! |
|
when will it be released? |
|
As written in the closed PR: Not sure if helpful for anyone else, but since this PR was open for a long time and i needed to publish my package i used this: It uses a timeout on the connect Future and the returned Future will resolve as soon as the connection is established. |
|
@KammererTob thanks. |
|
this fix is only for ioWebsocket but not for WebSocketChannel , what a pity; could any one tell me how to get the first message from the stream ; after the first message comes, I can make sure the connection is connected; then I can await for the others; |
|
You can use a platform specific api import and then define two different functions: _connect_api.dart: _connect_html.dart: _connect_io.dart: |
|
Someone going to fix the merge conflicts? |
|
@KammererTob would you by chance be up for resolving these conflicts? I've got a few PRs in other repos depending on this change and would love to get them merged 👍 |
|
Fixed merge conflicts. |
|
Any update on this PR? |
|
Any update? |
The Should we close this? |
|
@brianquinlan I closed the PR since as you said it is no longer needed/superseded. |
This pull request is a response to a comment in here: #60
I opened this new one since i don't have write access for the original pull request.
It contains the addition of a
readyFuture in the IOWebSochetChannel class, which completes when the underlying WebSocket connection is established. For the constructor which takes a WebSocket as input thisCompleterwill instantly complete since it is assumed that the WebSocket is already connected.It also contains a new timeout parameter which controls the timeout duration for the WebSocket future.
I also added tests, readme and changelog entries for both new additions. If you need anything else done please let me know.