Add first version of message passing and rpc

Reviewers: mtomic, buda

Reviewed By: mtomic, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1002
This commit is contained in:
Mislav Bradac
2017-12-05 13:41:51 +01:00
parent 8dcd8e1012
commit 60f4db2b9f
18 changed files with 1187 additions and 22 deletions

View File

@@ -79,6 +79,7 @@ TEST(Queue, AwaitPop) {
});
EXPECT_EQ(*q.AwaitPop(), 1);
std::this_thread::sleep_for(1000ms);
EXPECT_EQ(*q.AwaitPop(), 2);
EXPECT_EQ(*q.AwaitPop(), 3);
EXPECT_EQ(*q.AwaitPop(), 4);
@@ -86,12 +87,19 @@ TEST(Queue, AwaitPop) {
std::thread t2([&] {
std::this_thread::sleep_for(100ms);
q.Signal();
q.Shutdown();
});
std::this_thread::sleep_for(200ms);
EXPECT_EQ(q.AwaitPop(), std::experimental::nullopt);
t2.join();
}
TEST(Queue, AwaitPopTimeout) {
std::this_thread::sleep_for(1000ms);
Queue<int> q;
EXPECT_EQ(q.AwaitPop(100ms), std::experimental::nullopt);
}
TEST(Queue, Concurrent) {
Queue<int> q;