Skip to content

Commit 0ba02ff

Browse files
Merge pull request #42009 from ankitvijay/patch-3
Updated code snippet to use `IAsyncCollector`
2 parents 7377170 + 6540914 commit 0ba02ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

articles/azure-functions/functions-bindings-service-bus.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,12 @@ public static void Run(TimerInfo myTimer, ILogger log, out string outputSbQueue)
471471
Here's C# script code that creates multiple messages:
472472

473473
```cs
474-
public static void Run(TimerInfo myTimer, ILogger log, ICollector<string> outputSbQueue)
474+
public static async Task Run(TimerInfo myTimer, ILogger log, IAsyncCollector<string> outputSbQueue)
475475
{
476476
string message = $"Service Bus queue messages created at: {DateTime.Now}";
477477
log.LogInformation(message);
478-
outputSbQueue.Add("1 " + message);
479-
outputSbQueue.Add("2 " + message);
478+
await outputSbQueue.AddAsync("1 " + message);
479+
await outputSbQueue.AddAsync("2 " + message);
480480
}
481481
```
482482

0 commit comments

Comments
 (0)