#NEWLINE# def _bulker( self , bulk_size ) : #NEWLINE# #INDENT# '\n        Example:\n            u = bulker()\n            u.send(None)  #for generator initialize\n            u.send(json_str)  # input json item\n            u.send(another_json_str)  # input json item\n            ...\n            u.send(None) force finish bulk and post\n        ' #NEWLINE# while True : #NEWLINE# #INDENT# data = '' #NEWLINE# for i in range ( bulk_size ) : #NEWLINE# #INDENT# item = ( yield ) #NEWLINE# if data : #NEWLINE# #INDENT# data = ( ( data + item ) + '\n' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# print ( ( '-' * 10 ) ) #NEWLINE# if data : #NEWLINE# #INDENT# self . _post_to_es ( data )