def _continue_with_batch(self):
"""
Flushes one of batches (the longest one by default).
:param assert_no_batch: indicates whether exception must be
raised if there is no batch to flush
:return: the batch that was flushed, if there was a flush;
otherwise, ``None``.
"""
batch = self._select_batch_to_flush()
if batch is None:
if _debug_options.DUMP_FLUSH_BATCH:
debug.write('@async: no batch to flush')
else:
return None
self._batches.remove(batch)
self._flush_batch(batch)
return batch
评论列表
文章目录