Permalink
Browse files

Clarify emit synchronization should be on the collector

  • Loading branch information...
1 parent b27790a commit 737d17c226ff25a2538f0bf0bbde310b5ce32b1d Evan Chan committed Aug 30, 2012
Showing with 10 additions and 6 deletions.
  1. +10 −6 README.md
View
@@ -24,6 +24,16 @@ Useful features for Scala developers:
* Auto-boxing of Scala primitives in tuple emit and matchSeq
* A BoltDsl trait for using the DSL from any thread/actor/class
+Please Read For 0.2.2 / Storm 0.8.0 Users
+=========================================
+Storm 0.8.0 emits are no longer thread safe. You may see NullPointerExceptions with DisruptorQueue in the stack trace.
+If you are doing emits from multiple threads or actors, you will need to synchronize your emits or have them
+come from a single thread. You should synchronize on the collector instance:
+
+```scala
+ _collector.synchronized { tuple emit (val1, val2) }
+```
+
Getting Started
===============
@@ -54,12 +64,6 @@ If you want to build from source:
To help you get started, the ExclamationTopology and WordCountTopology examples from storm starter have been included.
-Please Read For 0.2.2 / Storm 0.8.0 Users
-=========================================
-Storm 0.8.0 emits are no longer thread safe. You may see NullPointerExceptions with DisruptorQueue in the stack trace.
-If you are doing emits from multiple threads or actors, you will need to synchronize your emits or have them
-come from a single thread.
-
Bolt DSL
========
The Scala DSL for bolts is designed to support many different bolt designs, including all 10 variants of the collector emit() and emitDirect() APIs. Getting started consists of extending the StormBolt class, passing a list of output fields, and defining the execute method:

0 comments on commit 737d17c

Please sign in to comment.