You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/08/17 23:10:18 UTC

[GitHub] [pulsar-dotpulsar] Chickenzilla commented on a change in pull request #48: Producer for Partitioned topics

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:
users@infra.apache.org