Here is my improved response... for reneging
Just before each entity enters the queue, stamp id, time of entry and a threshold time on it. Then have it cloned (duplicated) and send the duplicated entity to a dummy queue. Sort the dummy queue by threshold time. The dummy server in front of the dummy Queue then processes the entities for their threshold time. If the dummy server finishes before the actual server services a particular entity then the entity has overstayed its threshold. Hence make the dummy entity trigger order/send the original entity to exit. If the actual entity gets service first then just dispose the dummy entity. Use the id stamp to find the dummy/actual entities.
Hope this solution turns out to be a little less naive.
--
Karthik Vasudevan, PMC
|