<?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: track specific calls/callbacks in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/track-specific-calls-callbacks/m-p/1611035#M87078</link>
    <description>&lt;P&gt;This question resonates with some of the asynchronous tracking challenges we’ve faced outside of GIS. While dojo.Deferred is great for managing callbacks, attaching a unique identifier (like a timestamp or request ID) to each QueryTask call on the client side and maintaining a map of promises keyed to those IDs has worked well for us. In lead tracking systems like Phonexa, every call, click, and form submission is linked to a unique journey ID—it’s that kind of traceability that ensures we only act on relevant data, even when responses arrive out of order. Might be worth adopting a similar pattern for your spatial queries too.&lt;/P&gt;</description>
    <pubDate>Fri, 02 May 2025 09:36:17 GMT</pubDate>
    <dc:creator>SteveMarkovick</dc:creator>
    <dc:date>2025-05-02T09:36:17Z</dc:date>
    <item>
      <title>track specific calls/callbacks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/track-specific-calls-callbacks/m-p/18266#M1704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an esri.tasks.QueryTask that sends multiple requests to an ArcGIS Server service, which in turn calls the callback function upon completion.&amp;nbsp; (configured using the QueryTask's onComplete property)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any good way to correlate which calls to my QueryTask's execute function correspond to which callbacks?&amp;nbsp; Here's a hypothetical situation I'd like to have a good solution for:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A user makes a request for, say, the nearest 300 points to a particular object and submits it.&amp;nbsp; The QueryTask sends the request to the server, which takes a non-trivial time (say 15 seconds) to process.&amp;nbsp; In the meantime, the user decides he only wants 10 points, so he tells my app to cancel the first request and make a different one instead.&amp;nbsp; The QueryTask sends off this second request before the first one is received.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I would like is a way to differentiate between the requests when the results are received by my callback function.&amp;nbsp; In the example above, I want to be able to ignore the first request but process the second (realizing that either one could arrive back before the other).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only thing that I can think of is to pass a piece of identifying information to the server and have it echo it back in its response.&amp;nbsp; However, this might not work for me as I likely can't alter the server's response (and, for that matter, I'm not sure how to make the QueryTask pass along such info.&amp;nbsp; I guess I could replicate QueryTask on my own and add that ability but...why reinvent the wheel if I don't need to?).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any ideas you have,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Casey&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Oct 2010 02:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/track-specific-calls-callbacks/m-p/18266#M1704</guid>
      <dc:creator>CaseyBrown</dc:creator>
      <dc:date>2010-10-20T02:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: track specific calls/callbacks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/track-specific-calls-callbacks/m-p/18267#M1705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;querytask return dojo.deferred ( &lt;/SPAN&gt;&lt;A href="http://docs.dojocampus.org/dojo/Deferred"&gt;http://docs.dojocampus.org/dojo/Deferred&lt;/A&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can use for get track: &lt;/SPAN&gt;&lt;A href="http://www.dojotoolkit.org/api/dojo/Deferred.html"&gt;http://www.dojotoolkit.org/api/dojo/Deferred.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you have cancel, addErrback ect...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Oct 2010 13:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/track-specific-calls-callbacks/m-p/18267#M1705</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2010-10-20T13:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: track specific calls/callbacks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/track-specific-calls-callbacks/m-p/1611035#M87078</link>
      <description>&lt;P&gt;This question resonates with some of the asynchronous tracking challenges we’ve faced outside of GIS. While dojo.Deferred is great for managing callbacks, attaching a unique identifier (like a timestamp or request ID) to each QueryTask call on the client side and maintaining a map of promises keyed to those IDs has worked well for us. In lead tracking systems like Phonexa, every call, click, and form submission is linked to a unique journey ID—it’s that kind of traceability that ensures we only act on relevant data, even when responses arrive out of order. Might be worth adopting a similar pattern for your spatial queries too.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2025 09:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/track-specific-calls-callbacks/m-p/1611035#M87078</guid>
      <dc:creator>SteveMarkovick</dc:creator>
      <dc:date>2025-05-02T09:36:17Z</dc:date>
    </item>
  </channel>
</rss>

