def processSomeLines(self,rawLines):
    for lineNum,rawLine in enumerate(rawLines):
      try:
        line = filter(valid_chars_only, rawLine)
        if not line: continue
        (name,value,timestamp) = line.split()
        value = float(value)
        timestamp = int(float(timestamp)) # int("1.0") raises a TypeError
        pointStr = "%f %d" % (value,timestamp)
        #Try to put it in the cache, if we get back a deferred, we add a callback to resume processing later
        deferred = agentCloud.input(name,pointStr)
        if deferred:
          remainingLines = rawLines[lineNum:]
          deferred.addCallback( lambda result: self.processSomeLines(remainingLines) )
          return
        self.pype.logicalMessages += 1
      except:
        print 'ConsumerProtocol.handleMessage() invalid line: %s' % rawLine
        traceback.print_exc()
        continue

    #Only once we've gotten through all the lines are we ready for another message
    self.sendReadySignal()
Attempt to process as many lines as possible.
dataset/ETHPy150Open tmm1/graphite/misc/carbon-relay/pyped.py/ConsumerProtocol.processSomeLines