Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Async tasks implementation proposal

$
0
0
Re: Async tasks implementation proposal
FoxInCloud
Re: Async tasks implementation proposal
06/08/2012
04:28:39 PM
3IS0ZBFXL Show this entire thread in new window
Gratar Image based on email address
From:
Tuvia Vinitsky
To:
Attachments:
None
Maybe you want to start more simply -- maybe a Dialog window with a timeout that calles a function which checks the value of a fle or marker and adjusts the Dialog display accordingly? We are doing something like that in jvascript with window.interval. I had posted th other day the way we do it, but the post got mangled somehow. Maybe over the weekend I can post it again.


Hi,

I'd like to share with you an idea to simplify the implementation of long asynchronous tasks.

As always, we try to find solutions to preserve your code base as is.
Moving your code into a wwAsynchronousRequest sub-class may make too much changes ...

So the idea is

1- create aw.vcx!awFrm.wAsyncStart(<method of a form member>, parm1, parm2, parm3, etc.)

wAsyncStart():
- creates a process ID
- Instructs the client that an async process has started (ID, ...)
- instructs wc.dll that this server is busy (Rick, is this possible?)
- instantiates a timer which will start the <method> after say 20 ms, an estimated delay for current request to complete <-- this is the main trick

2- When FoxInCloud.js receives the response that an async process has started, it starts a .setInterval() on a server method that returns the % complete, displays a progress bar (persistent across forms)

3- create aw.vcx!awFrm.wAsyncProgress(% done)
the Async method calls thisform.wAsyncProgress(% done) whenever a step is completed

4- create aw.vcx!awFrm.wAsyncEnd(<result>)
this method:
- instructs wc.dll that this server is back to available (Rick, is this possible?)
- instructs client that async process is over - FoxinCloud.js stops polling and hides progress bar
- return whatever <result> is provided (a file presumably)

Any thoughts?



Viewing all articles
Browse latest Browse all 10393

Trending Articles