This is similar to @neilalexander PR (#5948) but has a slightly different approach. We use the struct to have a next so that we can use a list since the list will be maintained ordered. The for-loop is in one level, as opposed to two, which means that pushing to the IPQ will be "immediately" popped, even if we have a timer initialized and waiting to fire.
The timer is reset (not recreated everytime) only if the added response ends-up being at the head of the list.
Added a test that verifies that it works properly.
This is similar to @neilalexander PR (#5948) but has a slightly different approach. We use the struct to have a
next
so that we can use a list since the list will be maintained ordered. The for-loop is in one level, as opposed to two, which means that pushing to the IPQ will be "immediately" popped, even if we have a timer initialized and waiting to fire. The timer is reset (not recreated everytime) only if the added response ends-up being at the head of the list.Added a test that verifies that it works properly.
Signed-off-by: Ivan Kozlovic ivan@synadia.com