| 28 | } |
| 29 | |
| 30 | void 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 | |
| 54 | void EventQueue::AddClient(void *client) |
| 55 | { |
no test coverage detected