Example #1
0
        public async static Task <bool> Deliver(Message msg, DeliveryRule dr, bool wait)
        {
            string message = JsonConvert.SerializeObject(msg);
            bool   result  = true;

            foreach (Uri uri in dr.TargetEndpoints)
            {
                result &= await AttemptDeliveryAsync(message, uri).ConfigureAwait(false);
            }

            return(result);
        }
Example #2
0
        public static async Task <bool[]> DeliverAsync(Message msg, DeliveryRule dr)
        {
            string message = JsonConvert.SerializeObject(msg);

            List <Task <bool> > deliveries = new List <Task <bool> >();

            foreach (Uri uri in dr.TargetEndpoints)
            {
                deliveries.Add(AttemptDeliveryAsync(message, uri));
            }

            return(await Task.WhenAll(deliveries).ConfigureAwait(false));
        }