<?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 CancellationToken parameter on RouteTask methods (e.g. SolveRouteAsync)? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/cancellationtoken-parameter-on-routetask-methods-e/m-p/1265513#M11735</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We have an .NET Framework application that uses the ArcGIS Maps SDK for .NET version 200.0.&amp;nbsp; The app includes functionality for routing/navigation.&lt;/P&gt;&lt;P&gt;We would like for the user to be able to cancel the route calculation (for example, if it's taking too long, etc).&amp;nbsp; In the tasked-based async pattern in .NET (which we are using in our app), the recommendation is to support a CancellationToken parameter on asynchronous methods so that long running tasks can be cancelled if necessary.&lt;/P&gt;&lt;P&gt;Would it be possible to add the CancellationToken parameter to the RouteTask methods in a future release of the ArcGIS Maps SDK?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any recommendations on how best to handle cancellation in the meantime?&amp;nbsp; I was thinking of either letting the route solve continue to completion and then throwing away the result, or perhaps running the route solve in a separate thread and stopping that thread upon cancellation (which I'm concerned might lead to resource leaks).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidSchuster_0-1678291847485.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64698iE363765A2E36418E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DavidSchuster_0-1678291847485.png" alt="DavidSchuster_0-1678291847485.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2023 16:16:37 GMT</pubDate>
    <dc:creator>DavidSchuster</dc:creator>
    <dc:date>2023-03-08T16:16:37Z</dc:date>
    <item>
      <title>CancellationToken parameter on RouteTask methods (e.g. SolveRouteAsync)?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cancellationtoken-parameter-on-routetask-methods-e/m-p/1265513#M11735</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We have an .NET Framework application that uses the ArcGIS Maps SDK for .NET version 200.0.&amp;nbsp; The app includes functionality for routing/navigation.&lt;/P&gt;&lt;P&gt;We would like for the user to be able to cancel the route calculation (for example, if it's taking too long, etc).&amp;nbsp; In the tasked-based async pattern in .NET (which we are using in our app), the recommendation is to support a CancellationToken parameter on asynchronous methods so that long running tasks can be cancelled if necessary.&lt;/P&gt;&lt;P&gt;Would it be possible to add the CancellationToken parameter to the RouteTask methods in a future release of the ArcGIS Maps SDK?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any recommendations on how best to handle cancellation in the meantime?&amp;nbsp; I was thinking of either letting the route solve continue to completion and then throwing away the result, or perhaps running the route solve in a separate thread and stopping that thread upon cancellation (which I'm concerned might lead to resource leaks).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidSchuster_0-1678291847485.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64698iE363765A2E36418E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DavidSchuster_0-1678291847485.png" alt="DavidSchuster_0-1678291847485.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 16:16:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cancellationtoken-parameter-on-routetask-methods-e/m-p/1265513#M11735</guid>
      <dc:creator>DavidSchuster</dc:creator>
      <dc:date>2023-03-08T16:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: CancellationToken parameter on RouteTask methods (e.g. SolveRouteAsync)?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cancellationtoken-parameter-on-routetask-methods-e/m-p/1267366#M11738</link>
      <description>&lt;P&gt;For now you can just throw away the result. Most of the work is done server-side, and once the request is fired off, you can't really stop the server from doing the processing. You'd only save the download of the response, which is a minimal overhead in the grand total.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 23:13:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cancellationtoken-parameter-on-routetask-methods-e/m-p/1267366#M11738</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2023-03-13T23:13:59Z</dc:date>
    </item>
  </channel>
</rss>

