Pending Messages

Michael Doub mikedoub at gmail.com
Tue Feb 14 17:09:02 EST 2012


I am looking for some advise before start trying to figure out how throw away messages .

I am currently catching touch movement events and rendering a graph within a slider.  Clearly the rendering is slowing things a bit and I am 
experiencing some sluggishness.   I am thinking about trying to look at the pending messages from within the touch move handler and only processing the last move message.
Initially I was thinking of replacing the doit command below with a send after 0 ticks command but it seems to me this would only work if the TouchMove message is a higher priority than the doit message.  For that matter checking in the touch move handler assumes that the engine is adding touch messages to the pending message list at a higher priority that the TouchMove handler itself.

I don't think there is any notion of priority in the message path, so I am not sure if I am thinking about this problem correctly.   Can anyone provide me with a bit of advice on this topic. 

Thanks
  Mike




today:

On TouchMove tID, x, y
  doit x, y
end TouchMove

On doit
-- render here
End doit


Option 1:

On TouchMove tID,x,y
   look at pending messages
   capture the x y of the last message
   cancel all of the touch move messages
  doit x,y
End TouchMove


Option 2:

On TouchMove tID, x, y
  send ("doit" &&  x & comma & y) to me in 0 ticks
end TouchMove

On doit
   look at pending messages
   capture the x y of the last doit message
   cancel all of the doit messages
-- render here using last x y
End doit



More information about the use-livecode mailing list