Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The simplest and actual example code of LMAX Disruptor

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)?

like image 562
Dejwi Avatar asked Feb 06 '12 22:02

Dejwi


People also ask

What is LMAX Disruptor?

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.

Why use LMAX Disruptor?

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?

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.

What is Disruptor pattern?

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.


1 Answers

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

like image 111
Trevor Bernard Avatar answered Oct 12 '22 19:10

Trevor Bernard