Event queue speedup event handling
@@ -15,8 +15,11 @@ void DeRestPluginPrivate::initEventQueue()
*/
void DeRestPluginPrivate::eventQueueTimerFired()
{
- DBG_Assert(!eventQueue.empty());
+ int maxEvents = 10;
+ while (maxEvents > 0 && !eventQueue.empty())
+ {
+ maxEvents--;
const Event &e = eventQueue.front();
if (e.resource() == RSensors)
@@ -40,7 +43,6 @@ void DeRestPluginPrivate::eventQueueTimerFired()
if (device)
{
device->handleEvent(e);
-
}
// hack to forward first sub device name to core to show it as node name
@@ -61,6 +63,7 @@ void DeRestPluginPrivate::eventQueueTimerFired()
handleRuleEvent(e);
eventQueue.pop_front();
+ }
if (!eventQueue.empty())
{
