summaryrefslogtreecommitdiffstats
path: root/common/domain/mail.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-10-28 16:39:16 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-10-28 16:39:16 +0100
commit129333371d28c06d85f75ca579ce17798e615e84 (patch)
tree2ae01db9d26f6f72a74fa77e6937e03304e81a2c /common/domain/mail.cpp
parent20f049b65c4bd8c3d0c16bbf398641675648a93f (diff)
downloadsink-129333371d28c06d85f75ca579ce17798e615e84.tar.gz
sink-129333371d28c06d85f75ca579ce17798e615e84.zip
Made pipeline preprocessing synchronous.
Instead of having the asynchronous preprocessor concept with different pipelines for new/modify/delete we have a single pipeline with synchronous preprocessors that act upon new/modify/delete. This keeps the code simpler due to lack of asynchronity and keeps the new/modify/delete operations together (which at least for the indexing makes a lot of sense). Not supporting asynchronity is ok because the tasks done in preprocessing are not cpu intensive (if they were we had a problem since they are directly involved in the round-trip time), and the main cost comes from i/o, meaning we don't gain much by doing multithreading. Costly tasks (such as full-text indexing) should rather be implemented as post-processing, since that doesn't increase the round-trip time directly, and eventually consistent is typically good enough for that.
Diffstat (limited to 'common/domain/mail.cpp')
-rw-r--r--common/domain/mail.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp
index d40dde9..ffe322e 100644
--- a/common/domain/mail.cpp
+++ b/common/domain/mail.cpp
@@ -50,12 +50,11 @@ ResultSet TypeImplementation<Mail>::queryIndexes(const Akonadi2::Query &query, c
50 return ResultSet(keys); 50 return ResultSet(keys);
51} 51}
52 52
53void TypeImplementation<Mail>::index(const Mail &type, Akonadi2::Storage::Transaction &transaction) 53void TypeImplementation<Mail>::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction)
54{ 54{
55 const auto uid = type.getProperty("uid"); 55 const auto uid = bufferAdaptor.getProperty("uid");
56 if (uid.isValid()) { 56 if (uid.isValid()) {
57 Index uidIndex("mail.index.uid", transaction); 57 Index("mail.index.uid", transaction).add(uid.toByteArray(), identifier);
58 uidIndex.add(uid.toByteArray(), type.identifier());
59 } 58 }
60} 59}
61 60