Page 1 of 1

Make InternetPost/Get/Download run async

PostPosted: Tue Sep 28, 2010 1:33 am
by Tony Kroos
Please make Internet functions run independently of neobook actions, so we don't have to wait for operation to complete before proceeding to the next actions. If so, it is possible to create custom progressbars using [DownloadProgress] without plugins (i tried, but no luck). Now its just a numbers. Also you may want to add more [Progress] variables (for file copy/move etc.) and error handling if any. thanks.

PostPosted: Tue Sep 28, 2010 1:58 am
by smartmedia
Hi..

I agree you with you, my proposal to Dave is to add a process manager witch will handle all those functions needed to wait response from Internet to run independently without freeze the application. I don't know if this can be made but is very needful.

PostPosted: Tue Sep 28, 2010 4:13 am
by Tony Kroos
For future development, you may add this possibility for some other commands (just like option to keep executing next actions in moveobjectalongpath command), so neobook actions will execute in parallel threads, not step-by-step. Or at least implement such option only for subprocedures (there will be no "Return" command at the end of sub, the script which called the procedure will go on), so different subs may be called at the same time and run independently. Then neobook actions will be greatly more flexible.

PostPosted: Tue Sep 28, 2010 5:49 am
by Gaev
Tony, smartmedia:
Make InternetPost/Get/Download run async
All three commands have an option parameter where you can specify Async ... from the Help file ...
Allow NeoBook to respond to other input during the download. Without this option, NeoBook will not be able to accept user input until the download is complete.
I haven't used it myself ... but if this option does not allow you to continue processing your script ... you might consider use of the TimerObject ... set options Wait for "Timer Start" and Stop Timer after one execution ... and in the TimerInterval section, you can invoke the Internet related commands ... that will free the rest of NeoBook to respond to any of your other scripts and/or user interactions

Also from the Help file ...
[DownloadProgress]

This variable contains a number (0-100) that represents the progress of the current HTTP Action. Long HTTP Actions can be aborted by changing the contents of this variable to “Cancel”. For example:

SetVar "[DownloadProgress]" "Cancel"
Again, you can have ... the same Timer (without the "Execute Once" option) ... or another one ... that uses the value in this variable to display a Progress Bar

PostPosted: Tue Sep 28, 2010 10:04 am
by Neosoft Support
Interesting suggestions. I will print this topic and add it to our list of things to consider for the future.

PostPosted: Tue Sep 28, 2010 11:47 am
by Tony Kroos
All three commands have an option parameter where you can specify Async ... from the Help file ...

Async option just allows "User Input" to pub, but we talking about proceeding to the next actions. It is impossible until previous Internet-action is completed.

you might consider use of the TimerObject ... set options Wait for "Timer Start" and Stop Timer after one execution ... and in the TimerInterval section, you can invoke the Internet related commands ... that will free the rest of NeoBook to respond to any of your other scripts and/or user interactions


Of course, first of all I tried Timer - no luck, it works from time to time, but... anyway, next timer step will not completely execute until Internet-action is done. It seems, timer object doesnt run in pure parallel thread, just simulates it. If so, I think Timer object's workflow should be revised.