I try to implement a ConcurrentDictionary by wrapping it in a BlockingCollection but did not seem to be successful.
I understand that one variable declarations work with BlockingCollection such as ConcurrentBag<T>, ConcurrentQueue<T>, etc.
So, to create a ConcurrentBag wrapped in a BlockingCollection I would declare and instantiate like this:
BlockingCollection<int> bag = new BlockingCollection<int>(new ConcurrentBag<int>());
But how to do it for ConcurrentDictionary? I need the blocking functionality of the BlockingCollection on both the producer and consumer side.
You'll need to write your own adapter class - something like: