#NEWLINE# def process_ready_streams( self , batch_size , expire = False ) : #NEWLINE# #INDENT# streams = self . db . get_ready_streams ( batch_size , self . current_time ( ) , expire = stream ) #NEWLINE# stream_ct = len ( streams ) #NEWLINE# if expire : #NEWLINE# #INDENT# logger . debug ( ( 'Loaded %s streams to expire.' % stream_ct ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . debug ( ( 'Loaded %s streams to fire.' % stream_ct ) ) #NEWLINE# #UNINDENT# random . shuffle ( streams ) #NEWLINE# for stream in streams : #NEWLINE# #INDENT# if expire : #NEWLINE# #INDENT# self . expire_stream ( stream ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fire_stream ( stream ) #NEWLINE# #UNINDENT# #UNINDENT# self . streams_loaded += stream_ct #NEWLINE# return stream_ct