Function: sys.sleep

Suspends execution for the given number of seconds.

Maximum is 31536000 (one year).

For more information, see Wait using polling .

Arguments

Arguments
seconds
The number of seconds the execution should be suspended for.

Examples

 # Poll API until job status is complete 
 main 
 : 
  
 params 
 : 
  
 [ 
 jobId 
 ] 
  
 steps 
 : 
  
 - 
  
 getJob 
 : 
  
 # get job status 
  
 call 
 : 
  
 http.get 
  
 args 
 : 
  
 url 
 : 
  
 ${"https://example.com/jobs/" + jobId} 
  
 auth 
 : 
  
 type 
 : 
  
 OAuth2 
  
 result 
 : 
  
 jobStatus 
  
 - 
  
 checkIfDone 
 : 
  
 # check job status 
  
 switch 
 : 
  
 - 
  
 condition 
 : 
  
 ${jobStatus.complete} 
  
 return 
 : 
  
 ${jobStatus} 
  
 # stop polling 
  
 - 
  
 wait 
 : 
  
 call 
 : 
  
 sys.sleep 
  
 args 
 : 
  
 seconds 
 : 
  
 60 
  
 # wait 60 seconds 
  
 next 
 : 
  
 getJob 
Create a Mobile Website
View Site in Mobile | Classic
Share by: