MCPcopy Create free account
hub / github.com/apache/thrift / waitForConnEvent

Method waitForConnEvent

lib/cpp/test/processor/EventLog.cpp:110–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110Event EventLog::waitForConnEvent(uint32_t connId, int64_t timeout) {
111 Synchronized s(monitor_);
112
113 auto it = events_.begin();
114 while (true) {
115 try {
116 // TODO: it would be nicer to honor timeout for the duration of this
117 // call, rather than restarting it for each call to wait(). It shouldn't
118 // be a big problem in practice, though.
119 while (it == events_.end()) {
120 monitor_.wait(timeout);
121 }
122 } catch (const TimedOutException &) {
123 return Event(ET_LOG_END, 0, 0, "");
124 }
125
126 if (it->connectionId == connId) {
127 Event event = *it;
128 events_.erase(it);
129 return event;
130 }
131 }
132}
133}
134}
135} // apache::thrift::test

Callers

nothing calls this directly

Calls 4

EventClass · 0.70
beginMethod · 0.45
endMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected