#NEWLINE# def _get_multi( self , cmd , keys ) : #NEWLINE# #INDENT# grouped_addrs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for key in keys : #NEWLINE# #INDENT# addr = self . _key_to_addr ( key ) #NEWLINE# grouped_addrs . setdefault ( addr , [ ] ) . append ( key ) #NEWLINE# #UNINDENT# n = len ( grouped_addrs ) #NEWLINE# result_channel = ResultChannel ( ) #NEWLINE# for ( address , _keys ) in grouped_addrs . iteritems ( ) : #NEWLINE# #INDENT# connection = self . _get_connection ( address ) #NEWLINE# connection . _defer_command ( cmd , [ _keys ] , result_channel , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# values = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# result = MemcacheResult . OK #NEWLINE# receivedValues = [ ] #NEWLINE# for i in xrange ( 0 , n ) : #NEWLINE# #INDENT# receivedValues . append ( result_channel . get ( ) ) #NEWLINE# #UNINDENT# for ( _result , _values ) in receivedValues : #NEWLINE# #INDENT# if ( MemcacheResult . OK is _result ) : #NEWLINE# #INDENT# values . update ( _values ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = _result #NEWLINE# #UNINDENT# #UNINDENT# return ( result , self )