Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add automatic retry options for certain functions
#5
In next LA added wait.retry. It executes your code and waits/retries while it throws an exception.
 
Code:
Copy      Help
string file = @"C:\Test\test.txt";
string s = wait.retry(5, () => File.ReadAllText(file));
s = s.Upper();
wait.retry(5, () => { File.WriteAllText(file, s); });
print.it("ok");

Code:
Copy      Help
wait.retry(new(5) { Period = 100 }, () => { File.WriteAllText(file, s); });

wait.retry(5, () => { File.WriteAllText(file, s); }, e => e is IOException);


Messages In This Thread
RE: Add automatic retry options for certain functions - by Gintaras - 03-29-2024, 08:19 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)