10.6.3.1 ore_async_flag Argument
The special control argument ore_async_flag
determines if a
job is run synchronously or asynchronously. The default value is false.
Set the ore_async_flag
Argument
-
To run a function in synchronous mode, set
ore_async_flag
tofalse
.In synchronous mode, the SQL API waits for the HTTP call to finish and returns when the HTTP response is ready.
By default,
rq*Eval2
functions are executed synchronously. The default connection timeout limit is 60 seconds. Synchronous mode is used ifore_async_flag
is not set or if it's set tofalse
. -
To run a function in asynchronous mode, set
ore_async_flag
totrue
.In asynchronous mode, the SQL API returns a URL directly after the asynchronous job is submitted to the web server. The URL contains a job ID, which can be used to fetch the job status and result in subsequent SQL calls.
Submit Asynchronous Job Example
In the following code, the R function RandomRedDots2
is run in an
asynchronous mode with argument ore_async_flag
set to true.
%script
set long 500
SELECT * FROM table(rqEval2(
par_lst => '{"ore_async_flag":true, "ore_graphics_flag":true, "ore_service_level":"LOW"}',
out_fmt => NULL,
scr_name => 'RandomRedDots2'));
The VALUE
column of the result contains a URL containing the job ID of the asynchronous job:
NAME
--------------------------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
https://<host_name>/oml/api/r-scripts/v1/jobs/<job_id>
1 row selected.
Parent topic: Asynchronous Jobs