Research Article

Modeling Message Queueing Services with Reliability Guarantee in Cloud Computing Environment Using Colored Petri Nets

Algorithm 3

Function getIndexMsg.
Function description: find the oldest message in queue
Source code:
() fun getIndexMsg (msgs: Msgs, index: int) =
()  if #id (hd msgs) = index
()  then (hd msgs)
()  else getIndexMsg ((tl msgs), index)