blob: 02162a9e39579cf0a26db43a14fe6aee294517d9 [file] [log] [blame]
# This Python file uses the following encoding: utf-8
import storm
from random import random
class TesterBolt(storm.Bolt):
def initialize(self, conf, context):
storm.emit(['bolt initializing'])
def process(self, tup):
word = tup.values[0];
if (random() < 0.75):
storm.emit([word + 'lalala'], anchors=[tup])
storm.ack(tup)
else:
storm.log(word + ' randomly skipped!')
TesterBolt().run()