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

Re: Async

$
0
0
Re: Async
FoxInCloud
Re: Async
04/20/2012
10:13:37 AM
3HF0LX7DL Show this entire thread in new window
Gratar Image based on email address
From:
Thierry Nivelet (FoxInCloud)
To:
Attachments:
None
You are right
Short/interactive and Long/batch-type of operations should be segregated

It seems from the WC docs there is no way to dynamically alter the request timeout length, which would obviate the need for asynch in many cases.


Go that. What I mean is I am not sure of is running the server. The WC docs say first sent an event from the client. No problem:

SET PROCEDURE TO wwAsyncWebRequest ADDITIVE SET PROCEDURE TO wwXMLState ADDITIVE *** Event Initiator code (Web App most likely) o = CREATEOBJECT("wwAsyncWebRequest") lcId = o.SubmitEvent("Test Data","Sumbited at: " + TIME()) o.SetProperty("Name","Rick") o.SetProperty("Report","custlist") o.SetProperty("Time",DATETIME()) o.SetProperty("SQL","select * from TT_Cust") o.oEvent.UserId = "rstrahl" o.oEvent.Title = "Test Event" o.SaveEvent()

then the server running gets passed the LCID

LPARAMETERS lcID Application.Visible = .F. IF EMPTY(lcID) RETURN ENDIF SET PROCEDURE TO wwUtils ADDITIVE SET PROCEDURE TO wwXMLState Additive SET PROCEDURE TO wwAsyncWebRequest Additive SET CLASSLIB TO wwXML ADDITIVE loAsync = CREATEOBJECT("wwAsyncWebRequest") *** Load the Event IF !loAsync.LoadEvent(lcID) RETURN ENDIF WAIT WINDOW "Simulating long request taking 20 seconds..." TIMEOUT 20 ETC

Where does that server componnt code go? Do I just create the code and call it with the lcid? is there a timer component?

Can you give an example? not of the code as much as where you put the various codes related to FiC.


with FiC. Canb you give an example or two?


You just need to implement a timer in your HTML form calling (via AJAX) a server method polling the status table populated by wwAsyncWebRequest

Could you give an example of using wwAsyncWebRequest.prg!wwAsyncWebRequest?
I have, for example, a long report running. When it is done it will open in a pdf viewer.
I want to sent that process off async.





-- thn (FoxInCloud)


Viewing all articles
Browse latest Browse all 10393

Trending Articles