We have just released new functionality that allows someone to make an asynchronous call with any of our algorithms via our API. Prior to this every algorithm’s API call is a synchronous call which means if the algorithms takes 5 minutes to run, the API call will hold the connection for 5 minutes. This is not ideal in some situation. This now asynchronous call functionality allows you to run the same algorithm but instead of waiting around for it to finish, the system will return a job id to you and you can use that to query for the status of the job.
Let me show you how this works. It is not too different from before.
Making an asynchronous call. The only thing we are changing in the call is the parameter “method” is now set to “async”
This call will return immediately. Using the “job_id” you will make a query to checkout the status of this job.
The status will be in various states depending on the algorithm. There is one final state “ERROR” or “COMPLETED”. Once you see this, it is the final output. The results from the algorithm is placed into a datasource for you. The datasource id can be found in two places in the query job return. Both will have the same ID.
Thats about it. Making asynchronous calls easy!