How can a queryTask be executed synchronously? I'd like a feature set to be returned instead of deferred object. Thanks,
In instances like this, the API returns deferred objects in case you're interested in identifying when more than one request to a server has resolved, but its not something your application logic has to worry about if you're just dealing with one task at a time.
for example, when you call QueryTask.execute() and leverage the in-built callback, you can get a reference to the featureset output you want:
To work with QueryTask deferreds, you have an additional option to do something like this: