21 rtError EventEmitter::send(
Event&& event) {
22 auto handleEvent = [](gpointer data) -> gboolean {
25 while (!
self.m_eventQueue.empty())
27 rtObjectRef obj =
self.m_eventQueue.front();
28 self.m_eventQueue.pop();
30 rtError rc =
self.m_emit.send(obj.get<rtString>(
"name"), obj);
35 return G_SOURCE_REMOVE;
38 m_eventQueue.push(event.object());
40 if (m_timeoutId == 0) {
41 m_timeoutId = g_timeout_add(0, handleEvent, (
void*)
this);