To inquire about the status of a Thought Process (THOP) that is currently running, running the THOP via POST (or GET, although that is less useful) returns a location response header.
GET the URL in this header to access the status page for the THOP.
Note: These resources are only available with Thought Process Engine (TPE) 2.0.
GET
Returns status information about a THOP run as a JSON object.
THOPs run via POST are going through the following lifecycle: Initialized, running and finished.
Each of those events correspond to fields in the result. The value is a timestamp of the event.
Depending on the state of the THOP run, fields like 'finished' might not be present.
If a result is available, a corresponding result field will have the usual THOP result object.
If the THOP uses the `send()` function to send a partial result to the caller, a `partials` array is available (see second example) with result objects that contain timestamps on when the partial result was sent.
Partial results are only retained in a 30-second time window. If polling is used to request the result of a THOP, it must happen at least every 30 seconds to not miss a partial result.
Example output
{"running" : "2016-12-22T01:56:48.718Z","result" : {"result" : "Hello World!","duration" : 1,"debug" : "[]","error" : null }, "name" : "thop-test","initialized" : "2016-12-22T01:56:48.716Z","finished" : "2016-12-22T01:56:48.719Z","id" : "3b7dee66-2621-4d14-b30e-13750e37b0e9","status" : "finished" }
Example with partials
{"running":"2016-11-08T08:10:50.597Z","result":{"result":"done","duration":4229,"debug":"" },"name":"send-example","finished":"2016-11-08T08:10:54.835Z","id":"ed427f34-98e1-47ca-b852-d009c68547d7","partials":[ {"result":"Hello","ts":"2016-11-08T08:10:50.604Z" }, {"result":"World","ts":"2016-11-08T08:10:50.605Z" }, {"result":[ 1, 2, 3, 4 ],"ts":"2016-11-08T08:10:50.605Z" }, {"result":{"a":{"v":"london","c":"city" } },"ts":"2016-11-08T08:10:50.606Z" } ],"status":"finished" }