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

Async tasks implementation proposal

$
0
0
Async tasks implementation proposal
FoxInCloud
Async tasks implementation proposal
06/08/2012
01:34:47 AM
3IS03D4GG Show this entire thread in new window
Gratar Image based on email address
From:
Thierry Nivelet (FoxInCloud)
To:
All 
Attachments:
None
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?


Thierry Nivelet (FoxInCloud)


Viewing all articles
Browse latest Browse all 10393

Trending Articles