summaryrefslogtreecommitdiffstats
path: root/common/synchronizer.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-11-29 11:27:04 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-11-29 11:27:04 +0100
commit6a072b2dcf23cbcdb210f2bd5c273ea0f425b188 (patch)
treecc2789c59e04018743aa0d575ee51a6f10869ffc /common/synchronizer.h
parent81b459c0f013704e95fb5933525c82a6ca46f13f (diff)
downloadsink-6a072b2dcf23cbcdb210f2bd5c273ea0f425b188.tar.gz
sink-6a072b2dcf23cbcdb210f2bd5c273ea0f425b188.zip
The synchronization call can be sync.
... because we really just enqueue the request and then wait for the notification.
Diffstat (limited to 'common/synchronizer.h')
-rw-r--r--common/synchronizer.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/common/synchronizer.h b/common/synchronizer.h
index 989f902..f9b834e 100644
--- a/common/synchronizer.h
+++ b/common/synchronizer.h
@@ -44,7 +44,7 @@ public:
44 virtual ~Synchronizer(); 44 virtual ~Synchronizer();
45 45
46 void setup(const std::function<void(int commandId, const QByteArray &data)> &enqueueCommandCallback, MessageQueue &messageQueue); 46 void setup(const std::function<void(int commandId, const QByteArray &data)> &enqueueCommandCallback, MessageQueue &messageQueue);
47 KAsync::Job<void> synchronize(const Sink::QueryBase &query); 47 void synchronize(const Sink::QueryBase &query);
48 void flush(int commandId, const QByteArray &flushId); 48 void flush(int commandId, const QByteArray &flushId);
49 49
50 //Read only access to main storage 50 //Read only access to main storage
@@ -123,8 +123,9 @@ protected:
123 Flush 123 Flush
124 }; 124 };
125 125
126 SyncRequest(const Sink::QueryBase &q) 126 SyncRequest(const Sink::QueryBase &q, const QByteArray &requestId_ = QByteArray())
127 : requestType(Synchronization), 127 : requestId(requestId_),
128 requestType(Synchronization),
128 query(q) 129 query(q)
129 { 130 {
130 } 131 }
@@ -134,15 +135,15 @@ protected:
134 { 135 {
135 } 136 }
136 137
137 SyncRequest(RequestType type, int flushType_, const QByteArray &flushId_) 138 SyncRequest(RequestType type, int flushType_, const QByteArray &requestId_)
138 : flushType(flushType_), 139 : flushType(flushType_),
139 flushId(flushId_), 140 requestId(requestId_),
140 requestType(type) 141 requestType(type)
141 { 142 {
142 } 143 }
143 144
144 int flushType = 0; 145 int flushType = 0;
145 QByteArray flushId; 146 QByteArray requestId;
146 RequestType requestType; 147 RequestType requestType;
147 Sink::QueryBase query; 148 Sink::QueryBase query;
148 }; 149 };