So, according to Richard Salay comment:
Itโs best to run the request in the background thread and simply unsubscribe from the events of the container object when the user clicks โCancelโ.
And I think I agree that this is normal now. I would like to see some Async query features already in the framework, but until this happens, it should do so.
Have not started to implement this yet (you need to finish some other things first), but one of the ways it works:
- In a workflow, execute queries in a separate query thread, and then join that thread until it is completed.
- When the user clicks on cancel, call the
Interrupt method of the workflow, which will then receive a ThreadInterruptedException and stop waiting for the request flow to complete.
May add code later when I create it. But let's see how it turns out: p
Svish source share