diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-22 10:26:11 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-22 10:26:11 +0100 |
commit | b6981d94fb5fb12024738b639f9e389dd04578da (patch) | |
tree | f13e16f84ba9cf33782af7a0b0dbd82c5d65afd4 /common/synchronizer.h | |
parent | 1d713d9e2dbaf27de9da087f9270d260dfc40c31 (diff) | |
download | sink-b6981d94fb5fb12024738b639f9e389dd04578da.tar.gz sink-b6981d94fb5fb12024738b639f9e389dd04578da.zip |
Process change replays as part of the synchronization queue
Diffstat (limited to 'common/synchronizer.h')
-rw-r--r-- | common/synchronizer.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/synchronizer.h b/common/synchronizer.h index 0a51f54..9a71869 100644 --- a/common/synchronizer.h +++ b/common/synchronizer.h | |||
@@ -55,6 +55,9 @@ public: | |||
55 | void commit(); | 55 | void commit(); |
56 | Sink::Storage::DataStore::Transaction &syncTransaction(); | 56 | Sink::Storage::DataStore::Transaction &syncTransaction(); |
57 | 57 | ||
58 | public slots: | ||
59 | virtual void revisionChanged() Q_DECL_OVERRIDE; | ||
60 | |||
58 | protected: | 61 | protected: |
59 | ///Base implementation calls the replay$Type calls | 62 | ///Base implementation calls the replay$Type calls |
60 | virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE; | 63 | virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE; |
@@ -108,13 +111,26 @@ protected: | |||
108 | virtual KAsync::Job<void> synchronizeWithSource(const Sink::QueryBase &query) = 0; | 111 | virtual KAsync::Job<void> synchronizeWithSource(const Sink::QueryBase &query) = 0; |
109 | 112 | ||
110 | struct SyncRequest { | 113 | struct SyncRequest { |
114 | enum RequestType { | ||
115 | Synchronization, | ||
116 | ChangeReplay | ||
117 | }; | ||
118 | |||
111 | SyncRequest(const Sink::QueryBase &q) | 119 | SyncRequest(const Sink::QueryBase &q) |
112 | : flushQueue(false), | 120 | : flushQueue(false), |
121 | requestType(Synchronization), | ||
113 | query(q) | 122 | query(q) |
114 | { | 123 | { |
115 | } | 124 | } |
116 | 125 | ||
126 | SyncRequest(RequestType type) | ||
127 | : flushQueue(false), | ||
128 | requestType(type) | ||
129 | { | ||
130 | } | ||
131 | |||
117 | bool flushQueue; | 132 | bool flushQueue; |
133 | RequestType requestType; | ||
118 | Sink::QueryBase query; | 134 | Sink::QueryBase query; |
119 | }; | 135 | }; |
120 | 136 | ||