diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-22 18:25:31 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-22 18:25:31 +0100 |
commit | e513ee41adb6061aa72de8bfe49d117f47c1545b (patch) | |
tree | d91fd8abb5d2f47ec24dff497bcf18e218f01641 /examples | |
parent | ec16f3b92d6017462f4bba8354b53d1707850430 (diff) | |
download | sink-e513ee41adb6061aa72de8bfe49d117f47c1545b.tar.gz sink-e513ee41adb6061aa72de8bfe49d117f47c1545b.zip |
Support dependencies between sync requests.
If one sync task depends on the previous sync task we want to flush in
between, so we can query for the results of the previous sync request
locally.
If we detect such a dependency we temporarily halt all processing of
synchronization requests until the flush completes, so we can continue
processing.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/imapresource/imapresource.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 25d905b..06dc340 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -386,7 +386,8 @@ public: | |||
386 | list << Synchronizer::SyncRequest{query}; | 386 | list << Synchronizer::SyncRequest{query}; |
387 | } else { | 387 | } else { |
388 | list << Synchronizer::SyncRequest{Sink::QueryBase(ApplicationDomain::getTypeName<ApplicationDomain::Folder>())}; | 388 | list << Synchronizer::SyncRequest{Sink::QueryBase(ApplicationDomain::getTypeName<ApplicationDomain::Folder>())}; |
389 | list << Synchronizer::SyncRequest{applyMailDefaults(Sink::QueryBase(ApplicationDomain::getTypeName<ApplicationDomain::Mail>()))}; | 389 | //This request depends on the previous one so we flush first. |
390 | list << Synchronizer::SyncRequest{applyMailDefaults(Sink::QueryBase(ApplicationDomain::getTypeName<ApplicationDomain::Mail>())), QByteArray{}, Synchronizer::SyncRequest::RequestFlush}; | ||
390 | } | 391 | } |
391 | return list; | 392 | return list; |
392 | } | 393 | } |