Show / Hide Table of Contents

Method CancelAsync

CancelAsync()

Cancels this job and waits for any asynchronous server-side operations to be canceled.

Declaration
public Task<bool> CancelAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

The task returns true if the job was successfully canceled, false otherwise. The task always completes without an error. Returns false if server jobs were requested to cancel but the response was not successful. Also returns false if the job has reached Succeeded or Failed status.

Remarks

The job is canceled and will result in a Failed status after all cancellation tasks have completed. For jobs running on a server, a cancel request is sent for the associated ServerJobId. You should always cancel unneeded jobs (for example when exiting your app) to avoid placing unnecessary load on the server. Examples of server- side jobs include:

  • ExportTileCacheJob
  • ExportVectorTilesJob
  • GenerateGeodatabaseJob
  • GeoprocessingJob

In addition, the GenerateOfflineMapJob is composed of several server-side jobs, depending on the types of layers in your Map. Canceling this high-level job will also send a cancel request to the underlying server jobs.

Upon calling this method, the Status is immediately set to Canceling.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.14 - 200.7
.NET100.14 - 200.7
.NET Windows100.14 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.14 - 200.7
Xamarin.Android100.14 - 100.15
Xamarin.iOS100.14 - 100.15
UWP100.14 - 200.7
In This Article
Back to top Copyright © 2022 Esri.