#NEWLINE# @ retry ( wait_exponential_multiplier = 1000 , wait_exponential_max = 64000 , retry_on_exception = retry_read_after_error ) #NEWLINE# def read( self ) : #NEWLINE# #INDENT# log . info ( 'Set up ZK client using host(s): %s' , stat . _hosts ) #NEWLINE# zk = KazooClient ( hosts = self . _hosts ) #NEWLINE# zk . start ( ) #NEWLINE# self . _zk = zk #NEWLINE# try : #NEWLINE# #INDENT# ( data , stat ) = self . _readloop ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# log . info ( 'Shut down ZK client.' ) #NEWLINE# try : #NEWLINE# #INDENT# zk . stop ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# zk . close ( ) #NEWLINE# #UNINDENT# #UNINDENT# log . info ( 'Foreign payload stat: %s' , stat ) #NEWLINE# return data