controlling object from web
I want to create a robot with my controller and have it wait for an action command from the web.
From the web I call a function in my controller called web-action, and in web-action I set the action of the robot.
The problem is that I want the robot to execute the action for 10 timesteps and then return the result state at the end of web-action.
But when web-action is called it has complete control and I can't get it to wait for the simulation before returning.
I tried calling the iterate method of the robot directly in web-action but that doesn't work because no time passes. I don't know how to manually make the iteration step forward. I tried putting a call to "super iterate." within a for loop of web-action, but for some reason that doesn't work. I also tried calling "self iterate" in web-iterate and having a "super iterate" in that iterate, but that doesn't work either.
Any ideas? I would like to either:
1. Have function web-action wait for the simulation before returning, or
2. Have function web-action take control and call the iterate method of the actual simulation, or
3. Some other way I have not thought of to control the robot from the web, I don't want to create the robot each time, I want it to be there waiting for instructions, then execute those instructions and then return to the caller.
Thank you,
Jonathan

not currently possible...?
Hmm, I think that what you're looking for is not currently supported.
When a network connection occurs, the entire simulation is locked and is not allowed to proceed. No matter what you do during that network connection, I don't think you'll be able to get the engine to truly iterate forward.
Would is be possible to issue a second HTTP request to retrieve the result, or is that too much of a hassle?
- jon
Lots of options
In the old days coding required you to wrie your own event manager, for sending mouse clicks up through the call chain and etc. You have a couple options from my experience in web development php for instance has threads and session control to handle the timeout from the web side with two posts ?timer=0 ?timer=1, or run it reverse with myScript.tz posting ?ready=1 when your sim is complete then in php you could use a switch control it is a list based if/then/else. (don't forget steve has a call-method for objects that could be included in a network.tz subclass to relay commands. )Other scripting languages all have their variants for web development. I prefer php for its readability to me it makes more sense and is not as terse or over coded with arcane syntax found in other languages. I am sure I can find you some opensource code outhere for you. Drop me a line if you get lost. I thought alot about doing what you are talking about myself let me know how things work out.
Carry on
Keep me posted on your webdevelopment. The CLI works great, a cluster or breve servers is a good goal.