Job
Extends:
The Job class is used for job operations.
Constructor Summary
Public Constructor | ||
public |
constructor(client: Client, jobId: string, progressCallback: function(info: JobProgressInfo), startedCallback: function(info: JobStartedInfo)) |
Member Summary
Public Members | ||
public |
The job Id. |
Private Members | ||
private |
_client: * |
|
private |
_handler: * |
|
private |
_jobURL: * |
|
private |
_waiting: * |
Method Summary
Public Methods | ||
public |
Cancels the job. |
|
public |
Deletes the job. |
|
public |
Retrieves a workspace file. |
|
public |
Retrieves the job information. |
|
public |
wait(): Promise<JobResults, error> Waits for the job to complete. |
|
public |
Retrieves a list of the workspace files. |
Public Constructors
public constructor(client: Client, jobId: string, progressCallback: function(info: JobProgressInfo), startedCallback: function(info: JobStartedInfo)) source
Params:
Name | Type | Attribute | Description |
client | Client | The GSF Client object. |
|
jobId | string | The jobId. |
|
progressCallback | function(info: JobProgressInfo) |
|
The callback to handle job progress. |
startedCallback | function(info: JobStartedInfo) |
|
The callback that is called when the job starts. For more reliable job started information, listen to the GSF JobStarted events as this callback may not always get called. In some cases the job can start before the callback is registered. |
Public Members
Private Members
private _client: * source
private _handler: * source
private _jobURL: * source
private _waiting: * source
Public Methods
public cancel(force: boolean): Promise<true, error> source
Cancels the job.
Params:
Name | Type | Attribute | Description |
force | boolean | If true, the job will force cancel. Please note that setting force to true may be unsafe depending on the type of job as it may not be able to properly shut down or clean up. |
Return:
Promise<true, error> | Returns a promise when cancel is submitted. If request is successfully submitted, the promise will be resolved with a value of true. If the request fails, the promise will be resolved with an error message. Note that this only represents the success of the request made to the server, not the cancellation itself. Use the Job.Info() function (or Job events) to retrieve the status of the job and to learn when it is actually cancelled. |
public delete(): Promise<true, error> source
Deletes the job.
Return:
Promise<true, error> | Returns a promise when delete is submitted. If request is successfully submitted, the promise will be resolved with a value of true. If the request fails, the promise will be resolved with an error message. Note that this only represents the success of the request made to the server, not the deletion itself. Use the Job.Info() function (or Job events) to retrieve the status of the job and to learn when it is actually deleted. |
public file(fileName: *): Promise<arraybuffer, error> source
Retrieves a workspace file.
Params:
Name | Type | Attribute | Description |
fileName | * |
public wait(): Promise<JobResults, error> source
Waits for the job to complete.
Return:
Promise<JobResults, error> | Returns a promise that is resolved when a job is successful, returning the job results object. If a job fails, the promise is rejected with an error message. |