I wish I can get the simplest possible example code, which will show how to use LMAX disruptor(http://code.google.com/p/disruptor/).
Unfortunately every piece of code is out of date. Does someone know, where can I found small and up to date howto (preferable without DSL)?
lmax. disruptor Description. The Disruptor is a concurrent programming framework for exchanging and coordinating work as a continuous series of events. It can be used as an alternative to wiring processing stages together via queues.
The LMAX Disruptor is a design pattern that enables a separation of concerns between producing events (by single or multiple producers), processing them by consumers and coordinating the work between them.
How the Disruptor Works. Disruptor has an array based circular data structure (ring buffer). It is an array that has a pointer to next available slot. It is filled with pre-allocated transfer objects.
The disruptor pattern is a batching queue backed up by a circular array (i.e. the ring buffer) filled with pre-allocated transfer objects which uses memory-barriers to synchronize producers and consumers through sequences.
Here is a simple, runnable, example of how to use the Disruptor library. Example is written in Java using version 2.10.4 of the Disruptor library.
https://github.com/trevorbernard/disruptor-examples
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With