Research Article
Crafting a Real-Time Information Aggregator for Mobile Messaging
Algorithm 1
Algorithm of FCFS-based selection with LRU re-exhibition.
| // Select K messages in the approved message queue as | | requested | | | | Count all fresh messages, which are not yet exhibited, | | (with NULL value in “LastExhibitedTime” field) and set | | such the said count to N | | | | If | | Then | | 2.1 Designate the preceding K messages among these N | | messages by referring to “CreatedTime” as selected ones | | Else | | 2.2 Designate these N messages as selected ones | | 2.3 Designate the preceding K-N messages among old | | messages (with non-NULL value in “LastExhistedTime” | | field) by referring to “LastExhibitedTime” as selected ones | | End IF | | | | Update “LastExhibitedTime” values for these K | | .messages as the current time | | | | Return these K messages IDs |
|