开发者

Need help on performing asynchronous operations

开发者 https://www.devze.com 2023-04-06 00:12 出处:网络
I have a folder structure: Parent 1st Child 2nd Child 3rd Child ... There could be any number of child folders.

I have a folder structure:

  • Parent
    • 1st Child
    • 2nd Child
    • 3rd Child
    • ...

There could be any number of child folders.

On deleting parent it should delete all its subcategories and each subcategory is asscoiated to different entities (e.g. permissions).

If a user deletes a parent folder with a large amount (e.g. 1000) sub categories it takes a long time, and therefore the UI hangs (as it deletes the subfolders before parents).

How can I do this asynchronously - allowing the user to continue working with the UI while the delete completes in the background? How would I notify them that the work has completed?

This开发者_开发百科 is a web (ASP.Net) application.


If it's not a necessity that deleted categories must be deleted instantly, a solution would be to just mark the categories for deletion in way that is fast and that you can distinguish between live and removed items. You could build a background process on the server that periodically scans and deletes all marked items for real. You could then schedule this process in times with less server load so that server performance remains unaffected during high traffic times.

0

精彩评论

暂无评论...
验证码 换一张
取 消