Exemplo n.º 1
0
        public static async Task <List <IEvent> > DrainUntilHasEvents(this IEventStorage storage)
        {
            while (true)
            {
                var evt = await storage.DrainEvents().ConfigureAwait(false);

                if (evt.Any())
                {
                    return(evt);
                }
                await Task.Delay(100).ConfigureAwait(false);
            }
        }