Discussion

kill the requestor thread process while processing

Requirement: When we submit a new harness with two buttons one as

Submit Button, which will fetch/save the data to/from an external Database.

Cancel Button, which should be able to cancel the submitted request at the time ,when submit is processing, i.e. cancel button should be able to amputate the request processing thread with server.

Problem : When i give input to the form and submit i would like to cancel but i don't have control on Cancel button as it is going "Read-only" (both the buttons).

Need Suggestion: How to achieve control on Cancel button asynchronously and how to kill the requestor thread process while it is requesting.

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

March 28, 2012 - 12:11pm

NAGBHARANI wrote: How to achieve control on Cancel button asynchronously and how to kill the requestor thread process while it is requesting.

I recall that our 40th President, Ronald Reagan, figured that Trident missiles, once launched, could always be recalled. Your product manager must have similar notions.

Is this a "best effort" to try and kill the process? What is the user's recourse if the kill doesn't happen in time? Are you expecting it to be long running, or do you expect the user to have lightening-quick reflexes? Or do you have a problem with users getting cold feet after they click?

It's a difficult problem because, when engaged in a long-running request, any other request using the same requestor/thread is blocked. It's possible (I haven't tested it), that making a request on another thread can go through. Assuming you can kill the main requestor thread synchronously (again, don't know about that), then -- how do you even know it succeeded? Furthermore, you will have wiped out all of the Clipboard Pages, so you've got no road to recovery.

Maybe an easier hack is to have javascript incur a 3-second delay after the button is clicked.