Problem:
The aim is to design a custom queue that will pop out a message with the highest priority. Each input message has an already assigned priority value, although this isn’t a fixed value. The priority of each message is incremented after a fixed amount of time has passed.
Solution:
Let’s assume that there are a total of 5 different priority levels. 1 to 5, with 1 being the lowest and 5 being the highest. For every 10 minutes a message spends inside the queue, the priority is bumped up by 1 unit. The maximum priority value that can be assigned is 5. In case two elements have the same priority, the messages that have spent the longest in the queue should be popped out first. https://goo.gl/9p8HQn #DataIntegration #ML
Share this:
- Click to share on Facebook (Opens in new window)
- Click to share on Twitter (Opens in new window)
- Click to email a link to a friend (Opens in new window)
- Click to share on LinkedIn (Opens in new window)
- Click to share on Tumblr (Opens in new window)
- Click to share on Pinterest (Opens in new window)
- Click to share on Reddit (Opens in new window)