<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: When to use QueuedTask.Run in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/when-to-use-queuedtask-run/m-p/842544#M3920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok let me take a look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2020 20:50:44 GMT</pubDate>
    <dc:creator>AbelPerez</dc:creator>
    <dc:date>2020-03-30T20:50:44Z</dc:date>
    <item>
      <title>When to use QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/when-to-use-queuedtask-run/m-p/842542#M3918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see many examples with&amp;nbsp;QueuedTask.Run and am wondering when is the appropriate time to use it. In the examples below why would you want to wait for seemingly simple things like creating a spatial reference or creating a value array? Why is there a need to put these snippets in a&amp;nbsp;QueuedTask.Run task?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #24292e; background-color: #f6f8fa; padding: 16px;"&gt;&lt;SPAN class="" style="color: #6a737d;"&gt;// example of using ArcGIS.Core.Geometry.SpatialReference object&lt;/SPAN&gt;&lt;SPAN class="" style="color: #d73a49;"&gt;var&lt;/SPAN&gt; &lt;SPAN class="" style="color: #24292e;"&gt;spatial_ref&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;await&lt;/SPAN&gt; &lt;SPAN class="" style="color: #24292e;"&gt;QueuedTask&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;Run&lt;/SPAN&gt;(() &lt;SPAN class="" style="color: #d73a49;"&gt;=&amp;gt;&lt;/SPAN&gt; {     &lt;SPAN class="" style="color: #d73a49;"&gt;return&lt;/SPAN&gt; &lt;SPAN class="" style="color: #24292e;"&gt;SpatialReferenceBuilder&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;CreateSpatialReference&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #005cc5;"&gt;3857&lt;/SPAN&gt;); });&lt;SPAN class="" style="color: #6a737d;"&gt;// call MakeValueArray on spatial_ref so that ExecuteToolAsync can internally use the object&lt;/SPAN&gt;&lt;SPAN class="" style="color: #d73a49;"&gt;var&lt;/SPAN&gt; &lt;SPAN class="" style="color: #24292e;"&gt;sr_param&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #24292e;"&gt;Geoprocessing&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;MakeValueArray&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #24292e;"&gt;spatial_ref&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var valueArray = await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; var g = new List&amp;lt;object&amp;gt;() { geometry, };&lt;BR /&gt; // Creates a 8000-meter buffer around the geometry object&lt;BR /&gt; // null indicates a default output name is used&lt;BR /&gt; return Geoprocessing.MakeValueArray(g, null, @"8000 Meters");&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 18:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/when-to-use-queuedtask-run/m-p/842542#M3918</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2020-03-30T18:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: When to use QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/when-to-use-queuedtask-run/m-p/842543#M3919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abel,&lt;/P&gt;&lt;P&gt;More info you can find here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#using-queuedtask"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#using-queuedtask&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 18:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/when-to-use-queuedtask-run/m-p/842543#M3919</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2020-03-30T18:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: When to use QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/when-to-use-queuedtask-run/m-p/842544#M3920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok let me take a look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 20:50:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/when-to-use-queuedtask-run/m-p/842544#M3920</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2020-03-30T20:50:44Z</dc:date>
    </item>
  </channel>
</rss>

