Scenario is like :
In my application, I opened one file, updated it and saved. Once the file saved event get fired and it will execute one method abc()
.
But now, I want to add delay after save event get fired, say 1 minute. So I have added Thread.sleep(60000)
. Now it execute the method abc()
after 1 minute. Till now all works fine.
But suppose user saved file 3 times within 1 minute, the method get executed 3 times after each 1 minute. I want to execute method only one time in next 1 minute after first save called with latest file content.
How can I handle such scenario?