I'll state the problem at a really high level, first:
I would like to issue a statement to a server, and I don't care if it takes 15ms or 15 minutes, I would like to hear whatever it has to say exactly or as close to exactly when it comes back.
So, the solution and where I have a problem:
if (request.AsyncPostFromString(dataRequestString))
msg = wait(timeoutRequest, port)
I'm waiting.
...on an asynchronous request. :?
Solutions and thoughts thus far:viewtopic.php?f=34&t=49363&start=0&hilit=AsyncPostFromStringI could use the same port where I'm incidentally waiting on a message -- like for a string, for example
while true
msg = wait(0, screen.getmessageport())
if (msg.isscreenclosed())
The only problem is, say I've moved-on from that by using the screen-stack model:
http://sdkdocs.roku.com/display/sdkdoc/ ... th+ScreensIn this case, I issue the async request in ShowPosterScreen (using ShowPosterScreen's message port), but I move onto ShowSpringboardScreen...and somewhat halting the 'while' loop in ShowPosterScreen until completion of ShowSpringboardScreen.
While that while loop (ShowPosterScreen) is stopped and waiting on ShowSpringboardScreen to finish, I won't get any acknowledgement from that async request, even if it has finished.
One could have both ShowPosterScreen and ShowSpringboardScreen waiting on the same port, but it seems like one would have to worry about consumption of messages meant for the other (although, if the one is waiting for completion anyway...)
TL;DR - Is there a "how the pros do it" for AsyncPostFromString? So far everything I've found oversimplifies the use, IMHO.