Skip to content

Commit

Permalink
[event-hubs] Fixing broken sample (Azure#8695)
Browse files Browse the repository at this point in the history
Fixing missing 'async' keyword for snippet (and wrong client name) in readme.
  • Loading branch information
richardpark-msft authored May 5, 2020
1 parent e4bb34f commit 9ba92ec
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions sdk/eventhub/event-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,14 @@ async function main() {
};

const subscription = client.subscribe({
processEvents: (events, context) => {
// event processing code goes here
processEvents: (events, context) => {
// event processing code goes here
},
processError: (err, context) => {
// error reporting/handling code here
}
},
processError: (err, context) => {
// error reporting/handling code here
}
},
subscriptionOptions
subscriptionOptions
);

// Wait for a few seconds to receive events before closing
Expand Down Expand Up @@ -316,8 +316,8 @@ async function main() {
);

const subscription = consumerClient.subscribe({
processEvents: (events, context) => {
// event processing code goes here
processEvents: async (events, context) => {
// event processing code goes here

// Mark the last event in the batch as processed, so that when the program is restarted
// or when the partition is picked up by another process, it can start from the next event
Expand All @@ -331,7 +331,7 @@ async function main() {
// Wait for a few seconds to receive events before closing
setTimeout(async () => {
await subscription.close();
await client.close();
await consumerClient.close();
console.log(`Exiting sample`);
}, 3 * 1000);
}
Expand Down Expand Up @@ -370,14 +370,14 @@ async function main() {
};

const subscription = client.subscribe(partitionIds[0], {
processEvents: (events, context) => {
// event processing code goes here
processEvents: (events, context) => {
// event processing code goes here
},
processError: (err, context) => {
// error reporting/handling code here
}
},
processError: (err, context) => {
// error reporting/handling code here
}
},
subscriptionOptions
subscriptionOptions
);

// Wait for a few seconds to receive events before closing
Expand Down

0 comments on commit 9ba92ec

Please sign in to comment.