ArcGIS.AsyncJob (ArcGIS v1.0.2)

View Source

ArcGIS supports running various requests asyncronously.

In these cases, the response to a request is a document with a status and a URL. While the job is not completed, the URL updates the status of the job. When it is completed, the URL returns the results (if any).

Passing async: true to requests made through an ArcGIS.Portal will attempt to run the request asyncronously, and on success will return an %ArcGIS.AsyncJob{} struct.

To check on a job's status, pass an %ArcGIS.AsyncJob{} struct to ArcGIS.AyncJob.update/2.

Summary

Functions

Creates an %ArcGIS.AsyncJob{} from a raw response map

Attempts to fetch the update URL of the async job passed in, and returns a new %ArcGIS.AsyncJob{} struct.

If the passed in parameter is an async job, returns true.

Types

job_status()

@type job_status() ::
  :pending
  | :in_progress
  | :completed_successfully
  | :completed_with_errors
  | :unknown

t()

@type t() :: %ArcGIS.AsyncJob{status: job_status(), url: String.t()}

Functions

from_response(response)

@spec from_response(term()) :: t()

Creates an %ArcGIS.AsyncJob{} from a raw response map

update(job, options \\ [])

@spec update(t(), options :: ArcGIS.Portal.portal_options()) ::
  {:ok, t()} | {:ok, t(), map()} | {:error, reason :: String.t()}

Attempts to fetch the update URL of the async job passed in, and returns a new %ArcGIS.AsyncJob{} struct.

On job completion, any job result data will be returned as the third member of the returned tuple.

valid_response?(arg1)

@spec valid_response?(term()) :: boolean()

If the passed in parameter is an async job, returns true.