Skip to content

Commit

Permalink
docs: update list calls to async (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
irataxy authored and grayside committed Jan 18, 2023
1 parent 5c26829 commit d841846
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions media/livestream/listChannelEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ function main(projectId, location, channelId) {
const livestreamServiceClient = new LivestreamServiceClient();

async function listChannelEvents() {
const [events] = await livestreamServiceClient.listEvents({
const iterable = await livestreamServiceClient.listEventsAsync({
parent: livestreamServiceClient.channelPath(
projectId,
location,
channelId
),
});
console.info('Channel events:');
for (const event of events) {
console.info(event.name);
for await (const response of iterable) {
console.log(response.name);
}
}

Expand Down
6 changes: 3 additions & 3 deletions media/livestream/listChannels.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ function main(projectId, location) {
const livestreamServiceClient = new LivestreamServiceClient();

async function listChannels() {
const [channels] = await livestreamServiceClient.listChannels({
const iterable = await livestreamServiceClient.listChannelsAsync({
parent: livestreamServiceClient.locationPath(projectId, location),
});
console.info('Channels:');
for (const channel of channels) {
console.info(channel.name);
for await (const response of iterable) {
console.log(response.name);
}
}

Expand Down
6 changes: 3 additions & 3 deletions media/livestream/listInputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ function main(projectId, location) {
const livestreamServiceClient = new LivestreamServiceClient();

async function listInputs() {
const [inputs] = await livestreamServiceClient.listInputs({
const iterable = await livestreamServiceClient.listInputsAsync({
parent: livestreamServiceClient.locationPath(projectId, location),
});
console.info('Inputs:');
for (const input of inputs) {
console.info(input.name);
for await (const response of iterable) {
console.log(response.name);
}
}

Expand Down

0 comments on commit d841846

Please sign in to comment.