-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor event handling and cancellation in EventQueue and ResourceMa…
…nager Refactored the `EventQueue.cs` and `ResourceManager.cs` files to improve event handling and cancellation. The `try-catch` block has been moved inside the `while` loop in `EventQueue.cs` to ensure continuous event processing despite exceptions. The cancellation token check has been moved to the start of the `while` loop for immediate loop exit upon cancellation request. Simplified the `if` condition checking for null or cancelled events by removing nested `if` statements. In `ResourceManager.cs`, a `try-catch` block has been added inside the `async` lambda function to prevent exceptions from stopping the processing of subsequent events. The cancellation token check has been moved inside the `try` block to throw an exception upon cancellation request, allowing it to be caught and handled.
- Loading branch information
1 parent
45a2d4a
commit bd8ec13
Showing
2 changed files
with
95 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters