summaryrefslogtreecommitdiffstats
path: root/common/commandprocessor.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-12 11:45:15 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-12 11:45:15 +0100
commit7daeec83233c522980d5e477fee82045de57f77d (patch)
tree5e03d11d23c764eb03f27393fcc37c0529405e10 /common/commandprocessor.cpp
parentaf8baff21529b5bc47725da3e9e00ec81e5b6f1b (diff)
downloadsink-7daeec83233c522980d5e477fee82045de57f77d.tar.gz
sink-7daeec83233c522980d5e477fee82045de57f77d.zip
syncThen is no longer necessary
Diffstat (limited to 'common/commandprocessor.cpp')
-rw-r--r--common/commandprocessor.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/commandprocessor.cpp b/common/commandprocessor.cpp
index 7cd4a5f..87a120b 100644
--- a/common/commandprocessor.cpp
+++ b/common/commandprocessor.cpp
@@ -169,7 +169,7 @@ void CommandProcessor::process()
169 } 169 }
170 mProcessingLock = true; 170 mProcessingLock = true;
171 auto job = processPipeline() 171 auto job = processPipeline()
172 .syncThen<void>([this]() { 172 .then([this]() {
173 mProcessingLock = false; 173 mProcessingLock = false;
174 if (messagesToProcessAvailable()) { 174 if (messagesToProcessAvailable()) {
175 process(); 175 process();
@@ -193,10 +193,10 @@ KAsync::Job<qint64> CommandProcessor::processQueuedCommand(const Sink::QueuedCom
193 case Sink::Commands::InspectionCommand: 193 case Sink::Commands::InspectionCommand:
194 Q_ASSERT(mInspector); 194 Q_ASSERT(mInspector);
195 return mInspector->processCommand(data, size) 195 return mInspector->processCommand(data, size)
196 .syncThen<qint64>([]() { return -1; }); 196 .then(KAsync::value<qint64>(-1));
197 case Sink::Commands::FlushCommand: 197 case Sink::Commands::FlushCommand:
198 return flush(data, size) 198 return flush(data, size)
199 .syncThen<qint64>([]() { return -1; }); 199 .then(KAsync::value<qint64>(-1));
200 default: 200 default:
201 return KAsync::error<qint64>(-1, "Unhandled command"); 201 return KAsync::error<qint64>(-1, "Unhandled command");
202 } 202 }
@@ -234,7 +234,7 @@ KAsync::Job<void> CommandProcessor::processQueue(MessageQueue *queue)
234 [this, time](const QByteArray &data) -> KAsync::Job<void> { 234 [this, time](const QByteArray &data) -> KAsync::Job<void> {
235 time->start(); 235 time->start();
236 return processQueuedCommand(data) 236 return processQueuedCommand(data)
237 .syncThen<void, qint64>([this, time](qint64 createdRevision) { 237 .then([this, time](qint64 createdRevision) {
238 SinkTraceCtx(mLogCtx) << "Created revision " << createdRevision << ". Processing took: " << Log::TraceTime(time->elapsed()); 238 SinkTraceCtx(mLogCtx) << "Created revision " << createdRevision << ". Processing took: " << Log::TraceTime(time->elapsed());
239 }); 239 });
240 }) 240 })
@@ -251,7 +251,7 @@ KAsync::Job<void> CommandProcessor::processQueue(MessageQueue *queue)
251 } 251 }
252 }); 252 });
253 })) 253 }))
254 .syncThen<void>([this](const KAsync::Error &) { mPipeline->commit(); }); 254 .then([this](const KAsync::Error &) { mPipeline->commit(); });
255} 255}
256 256
257KAsync::Job<void> CommandProcessor::processPipeline() 257KAsync::Job<void> CommandProcessor::processPipeline()
@@ -273,7 +273,7 @@ KAsync::Job<void> CommandProcessor::processPipeline()
273 273
274 auto queue = it->next(); 274 auto queue = it->next();
275 return processQueue(queue) 275 return processQueue(queue)
276 .syncThen<KAsync::ControlFlowFlag>([this, time, it]() { 276 .then([this, time, it]() {
277 SinkTraceCtx(mLogCtx) << "Queue processed." << Log::TraceTime(time->elapsed()); 277 SinkTraceCtx(mLogCtx) << "Queue processed." << Log::TraceTime(time->elapsed());
278 if (it->hasNext()) { 278 if (it->hasNext()) {
279 return KAsync::Continue; 279 return KAsync::Continue;