Timers duration

220 views
Skip to first unread message

bartlomiej....@horus.com.pl

unread,
Nov 26, 2013, 4:14:02 AM11/26/13
to suppor...@runmyprocess.com
Hi,
I've got a workflow (I think it's common case):

1. Send request to external service - preparing data for process
2. Wait few seconds
3. Download data

For my workflow it's crucial to make 2. fast. Preparing data lasts about 10-15 seconds. Is it possible to make a RMP timer with duration in seconds?

thoshino

unread,
Nov 27, 2013, 1:39:03 AM11/27/13
to suppor...@runmyprocess.com, bartlomiej....@horus.com.pl
Hi,

You can try something like this in 1 of input or output variable scripts:
===
<@script env="javascript">
var start = Date.now() ;
var right_t = start;
while((right_t-start) < ([[throttle_period]][0][0])) {
     right_t = Date.now();
}
print(right_t-start);
</@script>
===
Please define variable "throttle_period" which is the sleep time in milliseconds.

And very IMPORTANT, use only minimum time for sleep - you process will fail. 
Our platform doesn't allow very scripts, that take long time to execute, to be written in input/output variables.

Best regards,

Taka
Reply all
Reply to author
Forward
0 new messages