def METHOD_NAME(self):
    # at most one instance of this function may be running at the same time
    while self._pending_batches:
        batch = self._pending_batches.pop(0)
        yield self._master.data.updates.addTestResults(self._builderid, self._setid, batch)