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
(1) Count all fresh messages, which are not yet exhibited,
   (with NULL value in “LastExhibitedTime” field) and set
   such the said count to N
(2)  If  N>K
   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
(3) Update “LastExhibitedTime” values for these K
   .messages as the current time
(4) Return these K messages IDs