ServiceSubmit[ServiceRequest[assoc]]

submits a request to be executed by an external service specified by assoc.

ServiceSubmit[ScheduledTask[req,spec]]

submits a task to evaluate ServiceRequest req on an external service following the schedule defined by spec.

ServiceSubmit[ContinuousTask[req,spec]]

submits a task to evaluate ServiceRequest req on an external service; the result of the request is updated whenever available.

Details and Options

  • ServiceSubmit works with a growing number of external services, given in the guide "Listing of Supported External Services".
  • $Services gives the list of available external services.
  • During the execution of the task, the following events can be generated:
  • "TaskStarted"task is started
    "ResultReceived"evaluation generated a result
    "TaskStatusChanged"task status changed
    "TaskFinished"task is completely finished
    "TaskRemoved"task is being removed
  • With the specification HandlerFunctions-><|,"eventi"->fi,|>, fi[assoc] is evaluated whenever eventi is generated. The elements of assoc have keys specified by the setting for HandlerFunctionsKeys.
  • Possible keys specified by HandlerFunctionsKeys include:
  • "Request"request being submitted
    "EvaluationResult"response received from the service
    "Task"the object representing the task
    "TaskStatus"the status of the task
    "TaskType"type of the task
    "TaskUUID"unique task identifier
  • The task submitted by ServiceSubmit is run in the current Wolfram Language session and has access to all variables and other states of that session.

Examples

open all close all

Basic Examples  (3)

Submit a request and set the received response:

In[1]:=
Click for copyable input
Out[1]=

Check the task status:

In[2]:=
Click for copyable input
Out[2]=

If the task is removed, check result:

In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input

Receive the event name and evaluation result:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Submit a request without specifying HandlerFunctionsKeys:

In[1]:=
Click for copyable input
Out[1]=

List the keys received:

In[2]:=
Click for copyable input
Out[2]=

Possible Issues  (2)

Introduced in 2019
(12.0)