Trisha has developed Java applications for a range of industries, including finance, manufacturing and non-profit, for companies of all sizes. She has expertise in Java high performance systems, is passionate about enabling developer productivity, and right now is getting to grips with working in an Open Source fashion as a developer for MongoDB Inc, where she contributes to the Java driver and Morphia. Trisha blogs regularly on subjects that she thinks developers and other humans should care about, she’s a leader of the Sevilla Java & MongoDB User Groups, a key member of the London Java Community and a Java Champion - she believes we shouldn't all have to make the same mistakes again and again. Trisha is a DZone MVB and is not an employee of DZone and has posted 66 posts at DZone. You can read more from them at their website. View Full User Profile

Strangeloop Disruptor Workshop Materials

10.07.2012
| 2635 views |
  • submit to reddit
On Sunday I gave my very first workshop on the Disruptor.  The aim was to give people some hands-on coding experience using the syntax.  Because time was limited (you can't get people to build an entire application architecture in 2.5 hours) the example is somewhat contrived, and needs a big leap to make it into a proper application context.  But the workshop should:
  1. Give an overview of the Disruptor
  2. Show how to create a simple one producer, one consumer example.
  3. Show how to wire up a parallel event handler
  4. Show how to how (and why) to create a diamond dependency graph.
  5. Extrapolate beyond these very simple examples to something closer to a real world architecture.
Requirements are:
  1. Basic Java skills
  2. Java 7 update 7
  3. (Optionally) IntelliJ.
The slides (not all that useful, I'll grant you, without me talking) are available, and you can download the code.

If you want to work through the examples yourself, start with com.mechanitis.towerdefense.TowerDefence.  The starting point code for the workshop is in package com.mechanitis.towerdefense.  com.mechanitis.towerdefense1 shows a solution to exercise one, com.mechanitis.towerdefense2 to exercise 2 and so forth.  The final package, com.mechanitis.towerdefense4, has some different towers you can play with to see the effects.  They don't really show anything special about the Disruptor, but they were fun to write and are interesting to play with.




Published at DZone with permission of Trisha Gee, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)