How to implement generic callbacks using the C# Task Parallel Library and IProducerConsumerCollection?
I have a component that submits requests to a web-based API, but these requests must be throttled so as not to contravene the API's data limits. This means that all requests must pass through a queue to control the rate at which they are submitted, but they can (and should) execute concurrently to achieve maximum throughput. Each request must return some data to the calling code at some point in the future when it completes. I'm struggling to create a nice model to handle the return of data. Using a BlockingCollection I can't just return a Task<TResult> from the Schedule method, because the