pitrou commented on code in PR #14188:
URL: https://github.com/apache/arrow/pull/14188#discussion_r977913171
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -174,19 +174,9 @@ class DatasetWriterFileQueue {
}
void ScheduleBatch(std::shared_ptr<RecordBatch> batch) {
- // TODO(ARROW-17110) This task is only here to std::move the batch
- // It can be a lambda once we adopt C++14
- struct WriteTask : public util::AsyncTaskScheduler::Task {
- WriteTask(DatasetWriterFileQueue* self, std::shared_ptr<RecordBatch>
batch)
- : self(self), batch(std::move(batch)) {}
- Result<Future<>> operator()(util::AsyncTaskScheduler*) {
- return self->WriteNext(std::move(batch));
- }
- DatasetWriterFileQueue* self;
- std::shared_ptr<RecordBatch> batch;
- };
- scheduler_->AddTask(
- ::arrow::internal::make_unique<WriteTask>(this, std::move(batch)));
+ scheduler_->AddSimpleTask([self = this, batch = std::move(batch)]() {
Review Comment:
That's a good question. I think either way is ok.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]