When you send messages to a Comet Actor with session.sendCometActorMessage which isn't set up yet, Lift stores messages in LiftSession.cometSetup List:
def setupComet(theType: String, name: Box[String], msg: Any) {
testStatefulFeature {
cometSetup.atomicUpdate(v => (Full(theType) -> name, msg) :: v)
}
}
Later, when the Comet Actor is set up, the messages are sent back to the actor in LiftSession.findComet:
for {
actor <- ret
(cst, csv) <- cometSetup.is if cst == what
} actor ! csv
Notice that Lift prepends messages to cometSetup List and reads those from head to tail, hence it sends messages in reverse order.
Which is, well, not what you expect from an actor.
Is it expected behaviour or a bug? Lift 2.6
Cheers,
Alex Nemish