JansthcirlU
JansthcirlU
CC#
Created by JansthcirlU on 2/11/2023 in #help
❔ ✅ Using generics that implement IEqualityOperators results in ambiguous call to the == operator
19 replies
CC#
Created by JansthcirlU on 9/8/2022 in #help
Simulation or game loop using async-await and events [Answered]
I'm trying to simulate a system with participants where the system periodically notifies the participants to perform an action. I'm trying to use async/await with a custom Task delegate but exceptions aren't handled the way I thought they would be. Please refer to the Sharplab demo URL for more information: https://pastebin.com/J55Xzb6H. I have an exception for Id == 5 which does not get caught. If I uncomment the next < score exception it always gets caught for the listener with the biggest Id (i.e. the last one to be added to the list). Is there a better approach to do this? I wanted to leverage async/await to prevent having to wait for all the listeners to perform their actions one at a time but I do want to handle exceptions correctly. Full Sharplab URL: https://sharplab.io/#v2:C4LgTgrgdgNAJiA1AHwMRQgG0wQwEaYCmABIVPkQLABQAAgEwCMNtADMbYwCwDcL7nAKx9qLAMwd6HRgHYaAbxrFlHCZwBsHABwdNAWRwBLKAAoAlEpWLqK28QCiAW0PBghMKWev3xALzEoQgB3cxE7FQAZQwBnYAAeKNiydwA+YkwYt0CwaL8A4NDLcIAzAHsPE2NgYkM81h4a4jjiRnqaxEQLG3Diax67DKTs6IA6AEE4OBNAkNrEFphPFzcwMzMwnoBfIrsyiqriACs6huPm4SOOrv6+/pVgMABPHZuXu+VaAE4l7zARpxchW6722wLuAGMcMBwQALYgmewAD3BhAADsBDKUoKRru9em93pxPiZCOsCXZQXiON9aOoRgARQi4R4mQSsVhksG2Sk9PaEHCw+EANxwHkwNWxgyy7miuPCt3emAZMVRpWihCB/R5ylBoPExDgTMIAHMoSRacQAGKGMCEMZQOCW8rGwjAMbRR5QcFxAAqAGUyIawIsffYhWQ3WBjdEUiZ/YH3AB+Yjqh3uENhiNjKO5UkifUMBxeFYKHa0CTW232x3O13uz3egG/RZNtxwTNQSPRlLJ1uEOAbZRltQ6C1N8w7BV2L66EYAJWgJnMfjSfbgiZGAEkoELSgBrDXAGExRYzEz0s0+wyOQgjABypSCa053Joeroaika47X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