예제 #1
0
 def run(self):
     global _ANCHOR_TUPLE
     storm_conf, context = read_handshake()
     tup = None
     try:
         self.initialize(storm_conf, context)
         while True:
             tup = read_tuple()
             _ANCHOR_TUPLE = tup
             self.process(tup)
             self.ack(tup)
     except Exception as e:
         self.raise_exception(e, tup)
예제 #2
0
 def run(self):
     """Main run loop for all bolts. Performs initial handshake with Storm
     and reads tuples handing them off to subclasses.  Any exceptions are
     caught and logged back to Storm prior to the Python process exits.
     Subclasses should not override this method.
     """
     storm_conf, context = read_handshake()
     tup = None
     try:
         self.initialize(storm_conf, context)
         while True:
             tup = read_tuple()
             self.process(tup)
     except Exception as e:
         self.raise_exception(e, tup)