Chickenzilla commented on a change in pull request #48:
URL: https://github.com/apache/pulsar-dotpulsar/pull/48#discussion_r471823131



##########
File path: src/DotPulsar/PulsarClient.cs
##########
@@ -80,7 +80,7 @@ public IProducer CreateProducer(ProducerOptions options)
                         producers[partID] = 
CreateProducerWithoutCheckingPartition(subproducerOption);
                     }));
                 }
-                Task.WaitAll(subproducerTasks.ToArray());
+                
Task.WhenAll(subproducerTasks.ToArray()).ConfigureAwait(false).GetAwaiter().GetResult();

Review comment:
       Using the async version of the function only to block on it reads like a 
code-smell to me, despite the fact that it should generally work.  Are you just 
trying to avoid the AggregateException?  If so, it should be easy enough to 
try/catch the AggregateException here and then throw the first inner exception.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to