public static T Execute( Func <T> func, ITransientFaultDetecter <Exception> detecter, int retryThreshold) { var handler = new DefaultTransientFaultHandler <T>( func, detecter, retryThreshold); return(handler.Execute()); }
public static string GetUriContent( this string uri, Func <HttpWebRequest, HttpWebRequest> funcSetCustomSettings = null, Encoding defaultEncoding = null, ITransientFaultDetecter <Exception> faultDetecter = null, int retryThreshold = 5) { var faultHandler = new DefaultTransientFaultHandler <string>( () => { return(GetUriContentDirectly(uri, funcSetCustomSettings, defaultEncoding)); }, faultDetecter ?? new DefaultHttpTransientFaultDetecter(), retryThreshold); return(faultHandler.Execute()); }