Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async Task Produce(ITargetBlock<string> queue, int howmuch)
- {
- Random r = new Random();
- while (howmuch-- > 0)
- {
- await Task.Delay(1000 * r.Next(1, 3));
- var v = string.Format("automatic {0}", r.Next(1, 10));
- await queue.SendAsync(v);
- }
- queue.Complete();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement