public static async Task <T[]> TakeAllAsync <T>(this ProducerConsumerQueue <T> producerConsumer) { return(await Task.Run(() => producerConsumer.TakeAll())); }
public static async Task <T[]> TakeBySizeAsync <T>(this ProducerConsumerQueue <T> producerConsumer, int maxSize, bool orFirstItem = false) { return(await Task.Run(() => producerConsumer.TakeBySize(maxSize))); }
public static async Task <T[]> TakeManyAsync <T>(this ProducerConsumerQueue <T> producerConsumer, int maxItems) { return(await Task.Run(() => producerConsumer.TakeMany(maxItems))); }
public static async Task PutManyAsync <T>(this ProducerConsumerQueue <T> producerConsumer, IEnumerable <T> items) { await Task.Run(() => producerConsumer.PutMany(items)); }
public static async Task PutAsync <T>(this ProducerConsumerQueue <T> producerConsumer, T item) { await Task.Run(() => producerConsumer.Put(item)); }
public static void Put <T>(this ProducerConsumerQueue <T> producerConsumer, T item) { producerConsumer.PutMany(new[] { item }); }