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

feat: support async iterator for paging method #708

Merged
merged 49 commits into from
Mar 20, 2020
Merged

Conversation

xiaozhenliu-gg5
Copy link
Contributor

@xiaozhenliu-gg5 xiaozhenliu-gg5 commented Jan 14, 2020

code example:

    const client = new showcase.v1beta1.EchoClient(clientOptions);
    // ... credential and auth ....
    const resources = client.pagedExpandAsync(request);
    let counter = 0;
    for await (const resource of resources){
       counter++;
       console.log(resource.content);
       if(counter === 10) break;
    }

Node8 tests are expected to fail, because this feature is new in Node10
TODO: update interface from typescript micro-generator

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 14, 2020
@codecov
Copy link

codecov bot commented Jan 14, 2020

Codecov Report

Merging #708 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #708   +/-   ##
=======================================
  Coverage   88.77%   88.77%           
=======================================
  Files          43       43           
  Lines        7357     7357           
  Branches      462      462           
=======================================
  Hits         6531     6531           
  Misses        823      823           
  Partials        3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6d423c...c6d423c. Read the comment docs.

@xiaozhenliu-gg5
Copy link
Contributor Author

Interface change in Typescript Micro-gen to make use of the async iterator is here: googleapis/gapic-generator-typescript#199
And it will be held until this PR is merged and released.

Copy link
Contributor

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

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

Thanks @xiaozhenliu-gg5! I think the functionality is now ready. All my comments are only related to style. Please fix the nits and feel free to merge the code!

As a general comment, it would be great to run prettier on the test application code since its formatting really got out of control.

@alexander-fenster
Copy link
Contributor

upd. "feel free to merge the code" when we finally deprecate Node 8 and not earlier :) (we'll remove node 8 check from Kokoro first)

@alexander-fenster alexander-fenster changed the title feat: support async iterator for paging method DO NOT MERGE: feat: support async iterator for paging method Jan 27, 2020
@alexander-fenster alexander-fenster changed the title DO NOT MERGE: feat: support async iterator for paging method feat: support async iterator for paging method Mar 20, 2020
@alexander-fenster alexander-fenster merged commit 3ac5afb into master Mar 20, 2020
@alexander-fenster alexander-fenster deleted the page_async branch March 20, 2020 02:12
gcf-merge-on-green bot pushed a commit that referenced this pull request Mar 26, 2020
🤖 I have created a release \*beep\* \*boop\* 
---
## [2.0.0](https://www.github.com/googleapis/gax-nodejs/compare/v1.14.2...v2.0.0) (2020-03-26)


### ⚠ BREAKING CHANGES

* use Node.js v10+
* throw for versions of Node.js older than v10.0.0 (#748)
* stop accepting Promise constructor (#737)

### Features

* export bundle descriptor in descriptors interface ([#744](https://www.github.com/googleapis/gax-nodejs/issues/744)) ([b1eccf9](https://www.github.com/googleapis/gax-nodejs/commit/b1eccf96c439d67376d249a54c9d22ffe7ff1839))
* export ServiceError from @grpc/grpc-js ([#754](https://www.github.com/googleapis/gax-nodejs/issues/754)) ([24a4d60](https://www.github.com/googleapis/gax-nodejs/commit/24a4d600738a9597e9a87d6705eaed3dc2285e3b))
* stop accepting Promise constructor ([#737](https://www.github.com/googleapis/gax-nodejs/issues/737)) ([816bf9b](https://www.github.com/googleapis/gax-nodejs/commit/816bf9b283217208debd979e893a6daf29f1f739))
* support async iterator for paging method ([#708](https://www.github.com/googleapis/gax-nodejs/issues/708)) ([3ac5afb](https://www.github.com/googleapis/gax-nodejs/commit/3ac5afb3b1b1b22798f15ee07395f3ca765383b4))
* throw for versions of Node.js older than v10.0.0 ([#748](https://www.github.com/googleapis/gax-nodejs/issues/748)) ([511fc23](https://www.github.com/googleapis/gax-nodejs/commit/511fc233bd66d537c24743ef460ee8c609cd551f))


### Bug Fixes

* **deps:** update dependency @grpc/grpc-js to ^0.7.0 ([#736](https://www.github.com/googleapis/gax-nodejs/issues/736)) ([01c428c](https://www.github.com/googleapis/gax-nodejs/commit/01c428cb1240320b92778abf1297a5ff72346fd9))
* **deps:** use @grpc/grpc-js v0.7.2 ([#735](https://www.github.com/googleapis/gax-nodejs/issues/735)) ([836e81b](https://www.github.com/googleapis/gax-nodejs/commit/836e81b64f84d8c118e6aea0580f0645658a8490))
* **deps:** use protobuf.js v6.8.9 ([#743](https://www.github.com/googleapis/gax-nodejs/issues/743)) ([fab91ce](https://www.github.com/googleapis/gax-nodejs/commit/fab91ce334d76212d7e31b5478331339c5acad76))
* allow passing numbers as path template parameters ([#756](https://www.github.com/googleapis/gax-nodejs/issues/756)) ([c466d3d](https://www.github.com/googleapis/gax-nodejs/commit/c466d3dc68c8f9050d3ae69dcedd708e3509ae17))


### Miscellaneous Chores

* require Node.js v10+ ([#759](https://www.github.com/googleapis/gax-nodejs/issues/759)) ([23ec7f6](https://www.github.com/googleapis/gax-nodejs/commit/23ec7f69c3813f6d06ea8b2a473d072337e1b499))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
yoshi-automation added a commit that referenced this pull request Apr 1, 2020
1c11c80
commit 1c11c80
Author: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Date:   Thu Mar 26 22:32:20 2020 +0000

    chore: release 2.0.0 (#738)

    🤖 I have created a release \*beep\* \*boop\*
    ---
    ## [2.0.0](https://www.github.com/googleapis/gax-nodejs/compare/v1.14.2...v2.0.0) (2020-03-26)

    ### ⚠ BREAKING CHANGES

    * use Node.js v10+
    * throw for versions of Node.js older than v10.0.0 (#748)
    * stop accepting Promise constructor (#737)

    ### Features

    * export bundle descriptor in descriptors interface ([#744](https://www.github.com/googleapis/gax-nodejs/issues/744)) ([b1eccf9](https://www.github.com/googleapis/gax-nodejs/commit/b1eccf96c439d67376d249a54c9d22ffe7ff1839))
    * export ServiceError from @grpc/grpc-js ([#754](https://www.github.com/googleapis/gax-nodejs/issues/754)) ([24a4d60](https://www.github.com/googleapis/gax-nodejs/commit/24a4d600738a9597e9a87d6705eaed3dc2285e3b))
    * stop accepting Promise constructor ([#737](https://www.github.com/googleapis/gax-nodejs/issues/737)) ([816bf9b](https://www.github.com/googleapis/gax-nodejs/commit/816bf9b283217208debd979e893a6daf29f1f739))
    * support async iterator for paging method ([#708](https://www.github.com/googleapis/gax-nodejs/issues/708)) ([3ac5afb](https://www.github.com/googleapis/gax-nodejs/commit/3ac5afb3b1b1b22798f15ee07395f3ca765383b4))
    * throw for versions of Node.js older than v10.0.0 ([#748](https://www.github.com/googleapis/gax-nodejs/issues/748)) ([511fc23](https://www.github.com/googleapis/gax-nodejs/commit/511fc233bd66d537c24743ef460ee8c609cd551f))

    ### Bug Fixes

    * **deps:** update dependency @grpc/grpc-js to ^0.7.0 ([#736](https://www.github.com/googleapis/gax-nodejs/issues/736)) ([01c428c](https://www.github.com/googleapis/gax-nodejs/commit/01c428cb1240320b92778abf1297a5ff72346fd9))
    * **deps:** use @grpc/grpc-js v0.7.2 ([#735](https://www.github.com/googleapis/gax-nodejs/issues/735)) ([836e81b](https://www.github.com/googleapis/gax-nodejs/commit/836e81b64f84d8c118e6aea0580f0645658a8490))
    * **deps:** use protobuf.js v6.8.9 ([#743](https://www.github.com/googleapis/gax-nodejs/issues/743)) ([fab91ce](https://www.github.com/googleapis/gax-nodejs/commit/fab91ce334d76212d7e31b5478331339c5acad76))
    * allow passing numbers as path template parameters ([#756](https://www.github.com/googleapis/gax-nodejs/issues/756)) ([c466d3d](https://www.github.com/googleapis/gax-nodejs/commit/c466d3dc68c8f9050d3ae69dcedd708e3509ae17))

    ### Miscellaneous Chores

    * require Node.js v10+ ([#759](https://www.github.com/googleapis/gax-nodejs/issues/759)) ([23ec7f6](https://www.github.com/googleapis/gax-nodejs/commit/23ec7f69c3813f6d06ea8b2a473d072337e1b499))
    ---

    This PR was generated with [Release Please](https://github.com/googleapis/release-please).
alexander-fenster pushed a commit that referenced this pull request Apr 1, 2020
* chore: use gts v2 (#757)

247aeb7
commit 247aeb7
Author: Alexander Fenster <[email protected]>
Date:   Thu Mar 26 13:04:10 2020 -0700

    chore: use gts v2 (#757)

    * chore: use gts v2

    * chore: ahhhhh thaaaats why

    * chore: do not run on node8

    * fix: new gts rules

* build: use TypeScript ^3.8.3, set lib to es2018 (#760)

41c73f8
commit 41c73f8
Author: Alexander Fenster <[email protected]>
Date:   Thu Mar 26 13:34:19 2020 -0700

    build: use TypeScript ^3.8.3, set lib to es2018 (#760)

    * build: use TypeScript ^3.8.3, set lib to es2018

    * fix: better typing

* chore!: require Node.js v10+ (#759)

23ec7f6
commit 23ec7f6
Author: Alexander Fenster <[email protected]>
Date:   Thu Mar 26 14:07:14 2020 -0700

    chore!: require Node.js v10+ (#759)

    BREAKING CHANGE: use Node.js v10+

* chore(deps): update dependency @types/rimraf to v3 (#751)

2f1b6ae
commit 2f1b6ae
Author: WhiteSource Renovate <[email protected]>
Date:   Thu Mar 26 22:27:20 2020 +0100

    chore(deps): update dependency @types/rimraf to v3 (#751)

    Co-authored-by: Alexander Fenster <[email protected]>

* chore: release 2.0.0 (#738)

1c11c80
commit 1c11c80
Author: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Date:   Thu Mar 26 22:32:20 2020 +0000

    chore: release 2.0.0 (#738)

    🤖 I have created a release \*beep\* \*boop\*
    ---
    ## [2.0.0](https://www.github.com/googleapis/gax-nodejs/compare/v1.14.2...v2.0.0) (2020-03-26)

    ### ⚠ BREAKING CHANGES

    * use Node.js v10+
    * throw for versions of Node.js older than v10.0.0 (#748)
    * stop accepting Promise constructor (#737)

    ### Features

    * export bundle descriptor in descriptors interface ([#744](https://www.github.com/googleapis/gax-nodejs/issues/744)) ([b1eccf9](https://www.github.com/googleapis/gax-nodejs/commit/b1eccf96c439d67376d249a54c9d22ffe7ff1839))
    * export ServiceError from @grpc/grpc-js ([#754](https://www.github.com/googleapis/gax-nodejs/issues/754)) ([24a4d60](https://www.github.com/googleapis/gax-nodejs/commit/24a4d600738a9597e9a87d6705eaed3dc2285e3b))
    * stop accepting Promise constructor ([#737](https://www.github.com/googleapis/gax-nodejs/issues/737)) ([816bf9b](https://www.github.com/googleapis/gax-nodejs/commit/816bf9b283217208debd979e893a6daf29f1f739))
    * support async iterator for paging method ([#708](https://www.github.com/googleapis/gax-nodejs/issues/708)) ([3ac5afb](https://www.github.com/googleapis/gax-nodejs/commit/3ac5afb3b1b1b22798f15ee07395f3ca765383b4))
    * throw for versions of Node.js older than v10.0.0 ([#748](https://www.github.com/googleapis/gax-nodejs/issues/748)) ([511fc23](https://www.github.com/googleapis/gax-nodejs/commit/511fc233bd66d537c24743ef460ee8c609cd551f))

    ### Bug Fixes

    * **deps:** update dependency @grpc/grpc-js to ^0.7.0 ([#736](https://www.github.com/googleapis/gax-nodejs/issues/736)) ([01c428c](https://www.github.com/googleapis/gax-nodejs/commit/01c428cb1240320b92778abf1297a5ff72346fd9))
    * **deps:** use @grpc/grpc-js v0.7.2 ([#735](https://www.github.com/googleapis/gax-nodejs/issues/735)) ([836e81b](https://www.github.com/googleapis/gax-nodejs/commit/836e81b64f84d8c118e6aea0580f0645658a8490))
    * **deps:** use protobuf.js v6.8.9 ([#743](https://www.github.com/googleapis/gax-nodejs/issues/743)) ([fab91ce](https://www.github.com/googleapis/gax-nodejs/commit/fab91ce334d76212d7e31b5478331339c5acad76))
    * allow passing numbers as path template parameters ([#756](https://www.github.com/googleapis/gax-nodejs/issues/756)) ([c466d3d](https://www.github.com/googleapis/gax-nodejs/commit/c466d3dc68c8f9050d3ae69dcedd708e3509ae17))

    ### Miscellaneous Chores

    * require Node.js v10+ ([#759](https://www.github.com/googleapis/gax-nodejs/issues/759)) ([23ec7f6](https://www.github.com/googleapis/gax-nodejs/commit/23ec7f69c3813f6d06ea8b2a473d072337e1b499))
    ---

    This PR was generated with [Release Please](https://github.com/googleapis/release-please).

* fix(deps): update dependency google-auth-library to v6 (#763)

72114db
commit 72114db
Author: WhiteSource Renovate <[email protected]>
Date:   Sat Mar 28 04:08:38 2020 +0100

    fix(deps): update dependency google-auth-library to v6 (#763)

* fix: make async iteration work for gRPC-fallback; refactor the code (#765)

944c06b
commit 944c06b
Author: Alexander Fenster <[email protected]>
Date:   Fri Mar 27 22:19:15 2020 -0700

    fix: make async iteration work for gRPC-fallback; refactor the code (#765)

* chore: release 2.0.1 (#766)

3ce902d
commit 3ce902d
Author: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Date:   Sat Mar 28 05:30:07 2020 +0000

    chore: release 2.0.1 (#766)

    🤖 I have created a release \*beep\* \*boop\*
    ---
    ### [2.0.1](https://www.github.com/googleapis/gax-nodejs/compare/v2.0.0...v2.0.1) (2020-03-28)

    ### Bug Fixes

    * **deps:** update dependency google-auth-library to v6 ([#763](https://www.github.com/googleapis/gax-nodejs/issues/763)) ([72114db](https://www.github.com/googleapis/gax-nodejs/commit/72114db1b15af3034c51a784e3fc619e2ee281e5))
    * make async iteration work for gRPC-fallback; refactor the code ([#765](https://www.github.com/googleapis/gax-nodejs/issues/765)) ([944c06b](https://www.github.com/googleapis/gax-nodejs/commit/944c06b4225c4dd5cdcf08e4ca2497cfe3a69cde))
    ---

    This PR was generated with [Release Please](https://github.com/googleapis/release-please).

* build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#770)

a1e4a3f
commit a1e4a3f
Author: Benjamin E. Coe <[email protected]>
Date:   Tue Mar 31 18:34:30 2020 -0700

    build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#770)

* fix: do not run node 8 CI (#456)

googleapis/synthtool@1b4cc80
commit 1b4cc80a7aaf164f6241937dd87f3bd1f4149e0c
Author: Alexander Fenster <[email protected]>
Date:   Wed Mar 25 08:01:31 2020 -0700

    fix: do not run node 8 CI (#456)

* fix: update template files for Node.js libraries (#463)

googleapis/synthtool@9982024
commit 99820243d348191bc9c634f2b48ddf65096285ed
Author: Alexander Fenster <[email protected]>
Date:   Tue Mar 31 11:56:27 2020 -0700

    fix: update template files for Node.js libraries (#463)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants