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 allclose all

Basic Examples  (3)

Submit a request and set the received response:

Check the task status:

If the task is removed, check result:

Receive the event name and evaluation result:

Submit a request without specifying HandlerFunctionsKeys:

List the keys received:

Possible Issues  (2)

Not all services support scheduled request:

Not all services support continuous request:

Wolfram Research (2019), ServiceSubmit, Wolfram Language function, https://reference.wolfram.com/language/ref/ServiceSubmit.html.

Text

Wolfram Research (2019), ServiceSubmit, Wolfram Language function, https://reference.wolfram.com/language/ref/ServiceSubmit.html.

CMS

Wolfram Language. 2019. "ServiceSubmit." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ServiceSubmit.html.

APA

Wolfram Language. (2019). ServiceSubmit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ServiceSubmit.html

BibTeX

@misc{reference.wolfram_2022_servicesubmit, author="Wolfram Research", title="{ServiceSubmit}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/ServiceSubmit.html}", note=[Accessed: 23-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2022_servicesubmit, organization={Wolfram Research}, title={ServiceSubmit}, year={2019}, url={https://reference.wolfram.com/language/ref/ServiceSubmit.html}, note=[Accessed: 23-November-2024 ]}