Am I missing something?

59 views
Skip to first unread message

Stephen

unread,
Feb 29, 2012, 4:42:31 PM2/29/12
to Disruptor
I was trying to code out a use case for this and I am now wondering if
this framework is just so easy or I am missing something.

Take a trade matching engine. Orders come in, log them then based on
the symbol, check for matches on existing orders. If there are
matches, create trades and update the orders to new volumes. Then send
the trades out.

Following this, is it as simple as:

executorService = Executors.newCachedThreadPool();
disruptor = new Disruptor<OrderEntry>(OrderEntry.FACTORY, ENTRIES,
executorService);
OrderEntryLogger orderEntryLogger = new OrderEntryLogger();
OrderEntryHandler orderEntryHandler = new OrderEntryHandler();
disruptor.handleEventsWith(orderEntryLogger).then(orderEntryHandler);
disruptor.start();
ringBuffer = disruptor.getRingBuffer();

Where OrderEntryLogger logs the event, and OrderEntryHandler checks
the market for matching trades.

What am I missing?

Michael Barker

unread,
Mar 1, 2012, 1:35:01 AM3/1/12
to lmax-di...@googlegroups.com
What am I missing?

Not much.  It should be that simple.  You may want to look at the EventPublisher/EventTranslator classes to publish events to the ring buffer.

Mike.
Reply all
Reply to author
Forward
0 new messages