MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / flush

Method flush

deps/cpp-statsd-client/include/cpp-statsd-client/UDPSender.hpp:332–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332inline void UDPSender::flush() noexcept {
333 // We aquire a lock but only if we actually need to (ie there is a thread also accessing the queue)
334 auto batchingLock =
335 m_batchingThread.joinable() ? std::unique_lock<std::mutex>(m_batchingMutex) : std::unique_lock<std::mutex>();
336 // Flush the queue
337 while (!m_batchingMessageQueue.empty()) {
338 sendToDaemon(m_batchingMessageQueue.front());
339 m_batchingMessageQueue.pop_front();
340 }
341}
342
343} // namespace Statsd
344

Callers 1

testSendRecvFunction · 0.45

Calls 1

emptyMethod · 0.45

Tested by 1

testSendRecvFunction · 0.36