I have a Flex application that calls a function which searches a large document collection. Depending on the search term, the user may want to stop the request from flex.
I’d like to not only stop the flex application from expecting the request, but also stop the CFC request. Is this possible? What’s the best approach for doing this?
To add onto Ben Doom’s answer, I’m including some example code of a way this can be accomplished. There are multiple approaches and ways of names, organizing and calling the code below, but hopefully it is helpful.
At some point during request start, store information about the process in shared scope and return an ID to the client. Here are example functions that could be used on page or remote requests.
Client can then check progress by polling server, or submit request to kill process
The actual server-side process in question can then hit a function, for example during a loop, to check whether it should abort processing and cleanup any work as appropriate.