DEV Community


Discussion on: Async/Await easy retry in c#

ilmtitan profile image
Jim Przybylinski

I don't think this library does what you think it does. Awaiting a task a second time does not restart the operation. For it to work, this test code will needs to pass:

        public async Task TestFailThenSucceed()
            int iteration = 1;
            await Task.Run(() =>
                if (iteration++ == 1)
                    throw new Exception();

It does not pass, and neither does the unit test you wrote.

alialp profile image
Ali Alp Author

You are right :) , I have fixed the code and released as version 2.0.0. your test has been included in the project as well :)