private static void OnTimerElapsed(object sender) { HostingEnvironment.QueueBackgroundWorkItem( async ct => { var i = 1; while (i > 0) { i = await PushNotificationDeliveryManager.SendNextReadyNotification(ct); } }); }
private static void OnTimerElapsed(object sender) { Console.Out.WriteLine("delivery timer elapsed"); var i = 1; while (i > 0) { var task = PushNotificationDeliveryManager.SendNextReadyNotification(CancellationToken.None); i = task.Result; if (i > 0) { Console.Out.WriteLine("one message delivered"); } } Console.Out.WriteLine("delivery complete"); }