public async Task ReceiveAsync(IContext context) { if (context.Message is DeliveryBatchMessage deliveryBatch) { // Console.WriteLine("got messages " + deliveryBatch.subscribers.Subscribers_.Count); var topicBatch = new TopicBatchMessage(deliveryBatch.ProducerBatch.Envelopes); var tasks = deliveryBatch .subscribers.Subscribers_ .Select(sub => DeliverBatch(context, topicBatch, sub)); //wait for completion await Task.WhenAll(tasks); context.Respond(new PublishResponse()); } }
private static Task DeliverBatch(IContext context, TopicBatchMessage pub, SubscriberIdentity s) => s.IdentityCase switch {