aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/storage.h
diff options
context:
space:
mode:
authornga <nga@yandex-team.ru>2022-02-10 16:48:09 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:09 +0300
commitc2a1af049e9deca890e9923abe64fe6c59060348 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/messagebus/storage.h
parent1f553f46fb4f3c5eec631352cdd900a0709016af (diff)
downloadydb-c2a1af049e9deca890e9923abe64fe6c59060348.tar.gz
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/storage.h')
-rw-r--r--library/cpp/messagebus/storage.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/messagebus/storage.h b/library/cpp/messagebus/storage.h
index f69b2ae857..7d168844ed 100644
--- a/library/cpp/messagebus/storage.h
+++ b/library/cpp/messagebus/storage.h
@@ -7,13 +7,13 @@
#include <contrib/libs/sparsehash/src/sparsehash/dense_hash_map>
#include <util/generic/deque.h>
-#include <util/generic/noncopyable.h>
-#include <util/generic/utility.h>
-
+#include <util/generic/noncopyable.h>
+#include <util/generic/utility.h>
+
namespace NBus {
namespace NPrivate {
typedef TVector<TBusMessage*> TMessagesPtrs;
-
+
class TTimedMessages {
public:
TTimedMessages();
@@ -21,19 +21,19 @@ namespace NBus {
struct TItem {
THolder<TBusMessage> Message;
-
+
void Swap(TItem& that) {
DoSwap(Message, that.Message);
}
};
-
+
typedef TDeque<TMoved<TItem>> TItems;
-
+
void PushBack(TNonDestroyingAutoPtr<TBusMessage> m);
TNonDestroyingAutoPtr<TBusMessage> PopFront();
bool Empty() const;
size_t Size() const;
-
+
void Timeout(TInstant before, TMessagesPtrs* r);
void Clear(TMessagesPtrs* r);
@@ -48,9 +48,9 @@ namespace NBus {
void Push(TBusMessagePtrAndHeader& m);
TBusMessage* Pop(TBusKey id);
-
+
void Timeout(TInstant before, TMessagesPtrs* r);
-
+
void Clear(TMessagesPtrs* r);
size_t Size() const {
@@ -62,33 +62,33 @@ namespace NBus {
void Gc();
void DumpState();
-
+
private:
struct TTimedItem {
TBusKey Key;
TBusInstant SendTime;
};
-
+
typedef TDeque<TTimedItem> TTimedItems;
typedef TDeque<TTimedItem>::iterator TTimedIterator;
-
+
TTimedItems TimedItems;
-
+
struct TValue {
TBusMessage* Message;
};
-
+
// keys are already random, no need to hash them further
struct TIdHash {
size_t operator()(TBusKey value) const {
return value;
}
};
-
+
typedef google::dense_hash_map<TBusKey, TValue, TIdHash> TKeyToMessage;
-
+
TKeyToMessage KeyToMessage;
- };
-
+ };
+
}
}