#NEWLINE# def push( self , interface , event ) : #NEWLINE# #INDENT# key = str ( self . key ( interface , event ) ) . encode ( 'utf-8' ) #NEWLINE# index = ( int ( hashlib . md5 ( key ) . hexdigest ( ) , 16 ) % self . partition_count ) #NEWLINE# logger . debug ( 'PUBLISH %s %s' , self . get_queue_name ( event ) , event ) #NEWLINE# self . interface . emit ( self . get_queue_name ( index ) , { #NEWLINE# #INDENT# 'event' : event . serialize ( ) , #NEWLINE# #UNINDENT# } )