Skip to main content

JobClient

ParallelModel TypeScript SDK


Class: JobClient<S, C, L, R, E, X>

Defined in: jobs.ts:14

Base client for job submission infrastructure, cancellation, status, logs and artifact downloads.

Extended by​

Type Parameters​

S​

S = unknown

Job submission response type.

C​

C = unknown

Job cancellation response type.

L​

L = unknown

Job log response type.

R​

R = unknown

Job result response type.

E​

E = unknown

Artifact extraction response type.

X​

X = unknown

Job status response type.

Constructors​

Constructor​

new JobClient<S, C, L, R, E, X>(transport, module, eventType, dataset?, typed?): JobClient<S, C, L, R, E, X>

Defined in: jobs.ts:24

Creates a JobClient instance.

Parameters​

transport​

Transport

Shared HTTP transport and authentication context.

module​

string

API module or pipeline module identifier.

eventType​

string

Artifact event identifier; defaults to the job client's configured event type when applicable.

dataset?​

boolean = false

Whether to use dataset-specific result and artifact routes.

typed?​

boolean = false

Whether selected lifecycle responses receive additional decoding.

Returns​

JobClient<S, C, L, R, E, X>

Properties​

dataset​

readonly dataset: boolean = false

Defined in: jobs.ts:24

Whether to use dataset-specific result and artifact routes.


eventType​

readonly eventType: string

Defined in: jobs.ts:24

Artifact event identifier; defaults to the job client's configured event type when applicable.


module​

readonly module: string

Defined in: jobs.ts:24

API module or pipeline module identifier.


typed​

readonly typed: boolean = false

Defined in: jobs.ts:24

Whether selected lifecycle responses receive additional decoding.

Methods​

cancelAsync()​

cancelAsync(modelId, jobId, computeSize, timeout?, signal?): Promise<C>

Defined in: jobs.ts:40

Requests cancellation of a remote job.

Parameters​

modelId​

string

UUID of the ParallelModel model that owns the resource.

jobId​

string

UUID of the remote job.

computeSize​

string

Compute-size identifier used in the job request header.

timeout?​

number

HTTP request timeout in milliseconds; omit to use the transport default.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

Returns​

Promise<C>

The job cancellation response data.


downloadBytesAsync()​

downloadBytesAsync(modelId, jobId, blobId, computeSize, inputEncryptionKey, timeout?, signal?): Promise<Uint8Array<ArrayBuffer>>

Defined in: jobs.ts:78

Downloads a stored artifact or blob as a Uint8Array.

Parameters​

modelId​

string

UUID of the ParallelModel model that owns the resource.

jobId​

string

UUID of the remote job.

blobId​

string

UUID of the stored blob.

computeSize​

string

Compute-size identifier used in the job request header.

inputEncryptionKey​

string

Base64-encoded 32-byte key for the input blob or job artifact.

timeout?​

number

HTTP request timeout in milliseconds; omit to use the transport default.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

Returns​

Promise<Uint8Array<ArrayBuffer>>

The downloaded file contents as bytes.


downloadToStreamAsync()​

downloadToStreamAsync(modelId, jobId, blobId, destination, computeSize, inputEncryptionKey, timeout?, signal?): Promise<void>

Defined in: jobs.ts:92

Streams a job artifact to a writable stream without closing the destination.

Parameters​

modelId​

string

UUID of the ParallelModel model that owns the resource.

jobId​

string

UUID of the remote job.

blobId​

string

UUID of the stored blob.

destination​

WritableStream<Uint8Array<ArrayBufferLike>>

Writable stream receiving the downloaded bytes without being closed by the SDK.

computeSize​

string

Compute-size identifier used in the job request header.

inputEncryptionKey​

string

Base64-encoded 32-byte key for the input blob or job artifact.

timeout?​

number

HTTP request timeout in milliseconds; omit to use the transport default.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

Returns​

Promise<void>

A promise that resolves when the stream transfer completes.


logAsync()​

logAsync(modelId, jobId, computeSize, timeout?, signal?): Promise<L>

Defined in: jobs.ts:62

Retrieves logs emitted by the remote job.

Parameters​

modelId​

string

UUID of the ParallelModel model that owns the resource.

jobId​

string

UUID of the remote job.

computeSize​

string

Compute-size identifier used in the job request header.

timeout?​

number

HTTP request timeout in milliseconds; omit to use the transport default.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

Returns​

Promise<L>

The job log response data.


statusAsync()​

statusAsync(modelId, jobId, computeSize, timeout?, signal?): Promise<X>

Defined in: jobs.ts:51

Retrieves the current status of a remote job.

Parameters​

modelId​

string

UUID of the ParallelModel model that owns the resource.

jobId​

string

UUID of the remote job.

computeSize​

string

Compute-size identifier used in the job request header.

timeout?​

number

HTTP request timeout in milliseconds; omit to use the transport default.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

Returns​

Promise<X>

The job status response data.