diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-20 01:12:23 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-20 01:12:23 +0200 |
commit | b10ca588b7a8a5e3bec22b9e683b4a4dbd5bc889 (patch) | |
tree | d9dffc7c8ef7caac35934fc38c410281911ac265 /common/synchronizer.h | |
parent | ea4d0708e63b7dc7ee0b1cb150f1e09da1f52046 (diff) | |
download | sink-b10ca588b7a8a5e3bec22b9e683b4a4dbd5bc889.tar.gz sink-b10ca588b7a8a5e3bec22b9e683b4a4dbd5bc889.zip |
Don't create a transaction for every appended message.
We create now only one transaction for the whole sync which is also not
ideal.
Diffstat (limited to 'common/synchronizer.h')
-rw-r--r-- | common/synchronizer.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/synchronizer.h b/common/synchronizer.h index 6f98f35..9c0e2e2 100644 --- a/common/synchronizer.h +++ b/common/synchronizer.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #include <Async/Async> | 24 | #include <Async/Async> |
25 | #include <domainadaptor.h> | 25 | #include <domainadaptor.h> |
26 | #include <query.h> | 26 | #include <query.h> |
27 | 27 | #include <messagequeue.h> | |
28 | #include "storage.h" | 28 | #include <storage.h> |
29 | 29 | ||
30 | namespace Sink { | 30 | namespace Sink { |
31 | class EntityStore; | 31 | class EntityStore; |
@@ -40,7 +40,7 @@ public: | |||
40 | Synchronizer(const QByteArray &resourceType, const QByteArray &resourceInstanceIdentifier); | 40 | Synchronizer(const QByteArray &resourceType, const QByteArray &resourceInstanceIdentifier); |
41 | virtual ~Synchronizer(); | 41 | virtual ~Synchronizer(); |
42 | 42 | ||
43 | void setup(const std::function<void(int commandId, const QByteArray &data)> &enqueueCommandCallback); | 43 | void setup(const std::function<void(int commandId, const QByteArray &data)> &enqueueCommandCallback, MessageQueue &messageQueue); |
44 | KAsync::Job<void> synchronize(); | 44 | KAsync::Job<void> synchronize(); |
45 | 45 | ||
46 | //Read only access to main storage | 46 | //Read only access to main storage |
@@ -105,6 +105,7 @@ private: | |||
105 | Sink::Storage::Transaction mTransaction; | 105 | Sink::Storage::Transaction mTransaction; |
106 | Sink::Storage::Transaction mSyncTransaction; | 106 | Sink::Storage::Transaction mSyncTransaction; |
107 | std::function<void(int commandId, const QByteArray &data)> mEnqueue; | 107 | std::function<void(int commandId, const QByteArray &data)> mEnqueue; |
108 | MessageQueue *mMessageQueue; | ||
108 | }; | 109 | }; |
109 | 110 | ||
110 | } | 111 | } |