Class JobsService
java.lang.Object
com.alibaba.dashscope.resources.jobs.JobsService
Generic async-task service (design §3): submit with
X-DashScope-Async: enable, poll
GET /tasks/{taskId}, cancel via POST /tasks/{taskId}/cancel, list via GET
/tasks. wait polls with a 1s → 8s backoff and a 24h default budget.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DurationUpper bound on the total wait budget (design §3). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancel(String taskId, RequestOptions options) create(String servicePath, com.fasterxml.jackson.databind.JsonNode body, RequestOptions options) Submit an async job: POSTservicePathwith the async header.create(String servicePath, com.fasterxml.jackson.databind.JsonNode body, Map<String, String> extraHeaders, RequestOptions options) Submit an async job carrying extra request headers (e.g. the OSS resolve opt-in).fetch(String taskId, RequestOptions options) list(Map<String, String> query, RequestOptions options) List jobs; query keys follow the wire names (page_no/page_size/model_name/status/...).wait(String taskId, RequestOptions options) Blocks until a terminal state; equivalent to repeatedlyjobs().fetchwith a 1s→8s backoff (default budget 24h).wait(String taskId, Duration waitTimeout, RequestOptions options)
-
Field Details
-
DEFAULT_WAIT_TIMEOUT
Upper bound on the total wait budget (design §3).
-
-
Constructor Details
-
JobsService
-
-
Method Details
-
create
public Job create(String servicePath, com.fasterxml.jackson.databind.JsonNode body, RequestOptions options) Submit an async job: POSTservicePathwith the async header. -
create
public Job create(String servicePath, com.fasterxml.jackson.databind.JsonNode body, Map<String, String> extraHeaders, RequestOptions options) Submit an async job carrying extra request headers (e.g. the OSS resolve opt-in). -
fetch
-
wait
Blocks until a terminal state; equivalent to repeatedlyjobs().fetchwith a 1s→8s backoff (default budget 24h). -
wait
-
cancel
-
list
List jobs; query keys follow the wire names (page_no/page_size/model_name/status/...).
-