Changeset 958 for trunk/docs
- Timestamp:
- Apr 16, 2020, 6:10:30 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/api/examples.rst
r725 r958 52 52 the ``storeExecuteResponse`` parameter in his request). 53 53 54 Asynchronous ZOO.Process example 55 -------------------------------- 56 57 :: 58 59 function RunAsynchonous(conf,inputs,outputs){ 60 var formatWPS=new ZOO.Format.WPS(); 61 var myProcess = new ZOO.Process(conf["main"]["serverAddress"],'Demo',true); 62 var myExecuteResult =myProcess.Execute(myInputs,myOutputs); 63 var response=formatWPS.read(myExecuteResult); 64 while(response.status){ 65 sleep(1500); 66 var response1 = ZOO.Request.Get(response.status.replace(/amp;/g,""),null); 67 response=formatWPS.read(response1); 68 } 69 conf["lenv"]["message"]="Asyncrhonous Process ended"; 70 ZOO.UpdateStatus(conf,90); 71 return {result: ZOO.SERVICE_SUCCEEDED, outputs: outputs}; 72 } 73 74 In this sample code, by creating the ZOO.Process, providing a third 75 argument set to true, we ensure that the WPS service execution will be run 76 asynchronously. Once the Execute WPS response is fetched, until the 77 service execution ends, the statusLocation is polled every 1,5 78 second.
Note: See TracChangeset
for help on using the changeset viewer.