#NEWLINE# def registerProducer( self , producer , streaming ) : #NEWLINE# #INDENT# "\n        Register to receive data from a producer.\n\n        This sets this selectable to be a consumer for a producer.  When this\n        selectable runs out of data on a write() call, it will ask the producer\n        to resumeProducing(). When the FileDescriptor's internal data buffer is\n        filled, it will ask the producer to pauseProducing(). If the connection\n        is lost, FileDescriptor calls producer's stopProducing() method.\n\n        If streaming is true, the producer should provide the IPushProducer\n        interface. Otherwise, it is assumed that producer provides the\n        IPullProducer interface. In this case, the producer won't be asked to\n        pauseProducing(), but it has to be careful to write() data only when its\n        resumeProducing() method is called.\n        " #NEWLINE# if ( self . producer is not None ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'Cannot register producer %s, because producer %s was never unregistered.' % ( producer , self . producer ) ) ) #NEWLINE# #UNINDENT# if self . disconnected : #NEWLINE# #INDENT# producer . stopProducing ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . producer = self #NEWLINE# self . streamingProducer = streaming #NEWLINE# if ( not streaming ) : #NEWLINE# #INDENT# producer . resumeProducing ( )