Why all ArcGis runtime methods for .net needs a task to be scheduled in the code?

1047
2
08-02-2016 09:39 PM
kaushivijay
New Contributor


I'm a .net developer who is just now starting to learn GIS. Looks like all the arcGis Runtime methods that we need to use in c# are tasks... Feels like the developer is responsible to tell the application when to run which task. I've never used the task scheduling before. I think some of you have already been at this point. Please advise...

0 Kudos
2 Replies
ThadTilton
Esri Contributor

Hi Kaushi -

I think you might find these resources helpful.

From MSDN, a discussion of the async/await pattern in .NET

Asynchronous Programming with async and await (C#)

From the ArcGIS Runtime SDK for .NET Developers Guide, using this pattern with ArcGIS Runtime

Asynchronous programming—ArcGIS Runtime SDK for .NET | ArcGIS for Developers

Thad

MichaelBranscomb
Esri Frequent Contributor

Hi,

The API is based on the modern .NET async pattern of Tasks and we therefore make extensive use of the C# language features async and await (or the equivalent in VB). Microsoft introduced Tasks in .NET 4.0 as a model for simplifying the process of writing multi-threaded applications. You can use .NET Tasks to asynchronously execute code without needing to worry about the actual threads performing the work. Tasks also provide much greater control over their execution and over what happens when they have completed, making it much simpler to: wait for a Task to complete; specify the order in which a number of Tasks should execute; or wait for several Tasks to all complete before executing a specific piece of code. Version 5 of the C# language further simplified working with Tasks with the addition of the ‘async’ and ‘await’ keywords. For more information about async Tasks please see Asynchronous Programming with Async and Await.

Cheers

Mike