#NEWLINE# def __init__( self , options , proc_num , auth = None ) : #NEWLINE# #INDENT# '\n        target_host and target_port are used as is\n        cid is used as cid_%d where the thread number is inserted\n        auth should be an array of "identity:key" strings, of the same size as\n        ratio\n        ' #NEWLINE# self . options = options #NEWLINE# self . cid_base = options . clientid #NEWLINE# self . auth = auth #NEWLINE# self . ratio = options . thread_ratio #NEWLINE# self . mosqs = [ ] #NEWLINE# if auth : #NEWLINE# #INDENT# assert ( len ( auth ) == self . ratio ) #NEWLINE# #UNINDENT# self . log = logging . getLogger ( ( ( __name__ + ':' ) + self . cid_base ) ) #NEWLINE# for x in range ( self . ratio ) : #NEWLINE# #INDENT# label = ( '%s_%d_%d' % ( self . cid_base , proc_num , x ) ) #NEWLINE# mb = MosquittoBridgeBroker ( options . host , label . port , label ) #NEWLINE# if auth : #NEWLINE# #INDENT# mb . auth = auth [ x ] . strip ( ) #NEWLINE# #UNINDENT# self . mosqs . append ( mb )