def consume_batch_async(self, batch):
        if not self.writer:
            self.writer = csv.writer(sys.stdout)
            self.writer.writerow(['id', 'flags', 'expiration', 'cas', 'value'])

        for msg in batch.msgs:
            cmd, vbucket_id, key, flg, exp, cas, meta, val = msg
            if self.skip(key, vbucket_id):
                continue

            try:
                if cmd == memcacheConstants.CMD_TAP_MUTATION:
                    self.writer.writerow([key, flg, exp, cas, val])
                elif cmd == memcacheConstants.CMD_TAP_DELETE:
                    pass
                elif cmd == memcacheConstants.CMD_GET:
                    pass
                else:
                    return "error: CSVSink - unknown cmd: " + str(cmd), None
            except __HOLE__:
                return "error: could not write csv to stdout", None

        future = pump.SinkBatchFuture(self, batch)
        self.future_done(future, 0)
        return 0, future
dataset/ETHPy150Open membase/membase-cli/pump_csv.py/CSVSink.consume_batch_async