MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ProcessEvent

Method ProcessEvent

lib/remote/eventqueue.cpp:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void EventQueue::ProcessEvent(const Dictionary::Ptr& event)
31{
32 Namespace::Ptr frameNS = new Namespace();
33 ScriptFrame frame(true, frameNS);
34 frame.Sandboxed = true;
35
36 try {
37 if (!FilterUtility::EvaluateFilter(frame, m_Filter.get(), event, "event"))
38 return;
39 } catch (const std::exception& ex) {
40 Log(LogWarning, "EventQueue")
41 << "Error occurred while evaluating event filter for queue '" << m_Name << "': " << DiagnosticInformation(ex);
42 return;
43 }
44
45 std::unique_lock<std::mutex> lock(m_Mutex);
46
47 for (auto& kv : m_Events) {
48 kv.second.push_back(event);
49 }
50
51 m_CV.notify_all();
52}
53
54void EventQueue::AddClient(void *client)
55{

Calls 3

LogClass · 0.85
push_backMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected