'Register to receive data from a producer.
This sets self to be a consumer for a producer.  When this object runs
out of data (as when a send(2) call on a socket succeeds in moving the
last data from a userspace buffer into a kernelspace buffer), it will
ask the producer to resumeProducing().
For L{IPullProducer} providers, C{resumeProducing} will be called once
each time data is required.
For L{IPushProducer} providers, C{pauseProducing} will be called
whenever the write buffer fills up and C{resumeProducing} will only be
called when it empties.
@type producer: L{IProducer} provider
@param producer: The L{IProducer} that will be producing data.
@type streaming: L{bool}
@param streaming: C{True} if C{producer} provides L{IPushProducer},
C{False} if C{producer} provides L{IPullProducer}.
@raise RuntimeError: If a producer is already registered.
@return: L{None}'

def registerProducer(self, producer, streaming):

    if (self._requestProducer is not None):
        raise RuntimeError(('Cannot    register    producer    %s,    because    producer    %s    was    never    unregistered.' % (producer, self._requestProducer)))
    if (not streaming):
        producer = _PullToPush(producer, self)
    self._requestProducer = producer
    self._requestProducerStreaming = streaming
    if (not streaming):
        producer.startStreaming()
