jpeck

jpeck / WaitTest / 0.1.1

README.md

Overview

When an algorithm calls another algorithm, the child call is subject to the default timeout (300 seconds): see https://docs.algorithmia.com/#query-parameters

This algo calls itself, allowing you to set the wait time and the timeout on the child calls.

Input

ParameterDescription
waitseconds for main algo to sleep
child_wait(optional) seconds for child call to sleep
child_timeout(optional) timeout to set on child call

Examples

Don't forget to set a timeout on the parent call!

example 1: not setting timeout option on long parent call

client.algo('jpeck/WaitTest')
.pipe({"wait":5,"child_wait":500}

Result: (timeout error on parent call)

example 2: not setting timeout option on long child call

client.algo('jpeck/WaitTest')
.set_options(timeout=800)
.pipe({"wait":5,"child_wait":500}

Result: (timeout error on child call)

example 3: both timeouts set properly

client.algo('jpeck/WaitTest')
.set_options(timeout=800)
.pipe({"wait":5,"child_wait":500,"child_timeout":800}

Result: waited 505.11083200003486