Yesterday I have taken the Disruptor-Net into production at a first criticial part of one of my applications. A great general overview of the pattern can be found in Martin Fowler’s blog.
The general plan for me is to get rid of BlockingCollection and use this instead. Fortunately I usually use the ConsumingEnumerable and thus the migration is easy and requires most of the work on the objects which are pushed to the queue to support update operations for object reuse.
I took this example as a guideline. Unfortunately the number of C# examples is limited. This is rather simple, but it feels a bit unelegant and clumpsy as it is very Java-ish, so I might look again at getting it more idiomatic and with less noise in the code. A BlockingCollection requires one class and this implementation requires three – I hope to get it down to two again to get rid of the EventHandler class and use delegates instead.
Performance is always about seeing for believing and it did look good. Using efficient collection is a great and rather safe way to improve the performance and latency.