storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [37/50] git commit: Add the equivalent of sleep(100) to randomsentence.js
Date Wed, 24 Sep 2014 17:57:04 GMT
Add the equivalent of sleep(100) to randomsentence.js


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/2921336a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/2921336a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/2921336a

Branch: refs/heads/security
Commit: 2921336a1889164a15044f9c5b53ee1458cd8d80
Parents: 7391d32
Author: Itai Frenkel <itai@ryzyco.com>
Authored: Tue Sep 9 20:35:45 2014 +0300
Committer: Itai Frenkel <itai@ryzyco.com>
Committed: Tue Sep 9 20:35:45 2014 +0300

----------------------------------------------------------------------
 .../storm-starter/multilang/resources/randomsentence.js  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/2921336a/examples/storm-starter/multilang/resources/randomsentence.js
----------------------------------------------------------------------
diff --git a/examples/storm-starter/multilang/resources/randomsentence.js b/examples/storm-starter/multilang/resources/randomsentence.js
index 57cec00..88912ad 100644
--- a/examples/storm-starter/multilang/resources/randomsentence.js
+++ b/examples/storm-starter/multilang/resources/randomsentence.js
@@ -35,10 +35,13 @@ RandomSentenceSpout.prototype.nextTuple = function(done) {
     var tup = [sentence];
     var id = this.createNextTupleId();
     this.pending[id] = tup;
-    this.emit({tuple: tup, id: id}, function(taskIds) {
-        self.log(tup + ' sent to task ids - ' + taskIds);
-    });
-    done();
+    //This timeout can be removed if TOPOLOGY_SLEEP_SPOUT_WAIT_STRATEGY_TIME_MS is configured
to 100
+    setTimeout(function() {
+        self.emit({tuple: tup, id: id}, function(taskIds) {
+            self.log(tup + ' sent to task ids - ' + taskIds);
+        });
+        done();
+    },100);
 }
 
 RandomSentenceSpout.prototype.createNextTupleId = function() {


Mime
View raw message