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

implements AsyncIterable<T> for Lister<T> #129

Merged
merged 1 commit into from
Mar 18, 2021
Merged

Conversation

nleguen
Copy link
Contributor

@nleguen nleguen commented Mar 18, 2021

When needed to retrieve all streams or consumers instead of a paged list, this simple change makes possible to do something like:

for await(const info of jsm.streams.list()) {
  console.log(info.config.name); // do whatever you want with the info
}

It doesn't break the actual API: jsm.streams.list().next() still returns a list for the paged result.

Copy link
Member

@aricart aricart left a comment

Choose a reason for hiding this comment

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

LGTM

@aricart aricart merged commit 08d138c into nats-io:main Mar 18, 2021
@aricart
Copy link
Member

aricart commented Mar 18, 2021

@nleguen thanks for the contribution

@aricart
Copy link
Member

aricart commented Mar 18, 2021

FIX #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants