当前位置: 首页 > news >正文

学校网站模板 中文网站开发公司需要哪些资质

学校网站模板 中文,网站开发公司需要哪些资质,深圳住房和建设局官网站,商务网站建设的第一步背景Polly是一个.NET弹性和瞬态故障处理库#xff0c;允许开发人员以流畅和线程安全的方式表达诸如重试#xff0c;断路器#xff0c;超时#xff0c;隔离头和回退之类的策略。Polly面向.NET Standard 1.1#xff08;覆盖范围#xff1a;.NET Core 1.0#xff0c;Mono允许开发人员以流畅和线程安全的方式表达诸如重试断路器超时隔离头和回退之类的策略。Polly面向.NET Standard 1.1覆盖范围.NET Core 1.0MonoXamarinUWPWP8.1 和.NET Standard 2.0覆盖范围.NET Core 2.0 、. NET Core 3.0和更高版本的MonoXamarin和UWP目标。nuget软件包还包括.NET Framework 4.6.1和4.7.2的直接目标。使用方式通过NuGet安装Install-Package Polly 代码实现故障处理响应策略故障处理策略处理您通过策略执行的委托引发的特定异常或          返回的结果。  步骤1指定您希望策略处理的异常/错误// Single exception type Policy.HandleHttpRequestException()// Single exception type with condition Policy.HandleSqlException(ex ex.Number 1205)// Multiple exception types Policy.HandleHttpRequestException().OrOperationCanceledException()// Multiple exception types with condition Policy.HandleSqlException(ex ex.Number 1205).OrArgumentException(ex ex.ParamName example)// Inner exceptions of ordinary exceptions or AggregateException, with or without conditions // (HandleInner matches exceptions at both the top-level and inner exceptions) Policy.HandleInnerHttpRequestException().OrInnerOperationCanceledException(ex ex.CancellationToken ! myToken) 步骤2指定策略应如何处理这些故障2.1、重试‍// Retry once Policy.HandleSomeExceptionType().Retry()// Retry multiple times Policy.HandleSomeExceptionType().Retry(3)// Retry multiple times, calling an action on each retry // with the current exception and retry count Policy.HandleSomeExceptionType().Retry(3, onRetry: (exception, retryCount) {// Add logic to be executed before each retry, such as logging});// Retry multiple times, calling an action on each retry // with the current exception, retry count and context // provided to Execute() Policy.HandleSomeExceptionType().Retry(3, onRetry: (exception, retryCount, context) {// Add logic to be executed before each retry, such as logging }); 2.2、永远重试直到成功// Retry forever Policy.HandleSomeExceptionType().RetryForever()// Retry forever, calling an action on each retry with the // current exception Policy.HandleSomeExceptionType().RetryForever(onRetry: exception {// Add logic to be executed before each retry, such as logging });// Retry forever, calling an action on each retry with the // current exception and context provided to Execute() Policy.HandleSomeExceptionType().RetryForever(onRetry: (exception, context) {// Add logic to be executed before each retry, such as logging }); 2.3、等待并重试// Retry, waiting a specified duration between each retry. // (The wait is imposed on catching the failure, before making the next try.) Policy.HandleSomeExceptionType().WaitAndRetry(new[]{TimeSpan.FromSeconds(1),TimeSpan.FromSeconds(2),TimeSpan.FromSeconds(3)});// Retry, waiting a specified duration between each retry, // calling an action on each retry with the current exception // and duration Policy.HandleSomeExceptionType().WaitAndRetry(new[]{TimeSpan.FromSeconds(1),TimeSpan.FromSeconds(2),TimeSpan.FromSeconds(3)}, (exception, timeSpan) {// Add logic to be executed before each retry, such as logging }); // Retry, waiting a specified duration between each retry, // calling an action on each retry with the current exception, // duration and context provided to Execute() Policy.HandleSomeExceptionType().WaitAndRetry(new[]{TimeSpan.FromSeconds(1),TimeSpan.FromSeconds(2),TimeSpan.FromSeconds(3)}, (exception, timeSpan, context) {// Add logic to be executed before each retry, such as logging });// Retry, waiting a specified duration between each retry, // calling an action on each retry with the current exception, // duration, retry count, and context provided to Execute() Policy.HandleSomeExceptionType().WaitAndRetry(new[]{TimeSpan.FromSeconds(1),TimeSpan.FromSeconds(2),TimeSpan.FromSeconds(3)}, (exception, timeSpan, retryCount, context) {// Add logic to be executed before each retry, such as logging });// Retry a specified number of times, using a function to // calculate the duration to wait between retries based on // the current retry attempt (allows for exponential backoff) // In this case will wait for // 2 ^ 1 2 seconds then // 2 ^ 2 4 seconds then // 2 ^ 3 8 seconds then // 2 ^ 4 16 seconds then // 2 ^ 5 32 seconds Policy.HandleSomeExceptionType().WaitAndRetry(5, retryAttempt TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)) );// Retry a specified number of times, using a function to // calculate the duration to wait between retries based on // the current retry attempt, calling an action on each retry // with the current exception, duration and context provided // to Execute() Policy.HandleSomeExceptionType().WaitAndRetry(5, retryAttempt TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), (exception, timeSpan, context) {// Add logic to be executed before each retry, such as logging});// Retry a specified number of times, using a function to // calculate the duration to wait between retries based on // the current retry attempt, calling an action on each retry // with the current exception, duration, retry count, and context // provided to Execute() Policy.HandleSomeExceptionType().WaitAndRetry(5, retryAttempt TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), (exception, timeSpan, retryCount, context) {// Add logic to be executed before each retry, such as logging}); 开源地址https://github.com/App-vNext/Polly
http://www.fuzeviewer.com/news/39759/

相关文章:

  • 苏州现代建设公司网站泵网站建设
  • 简单干净的网站宿迁市区建设局网站
  • 网络建站的费用律师网站建设
  • 昆明网站建设天猫运营快速网站建设公司哪家好
  • 有口碑的宜昌网站建设施工企业分录
  • 电子商务网站建设方案推荐网站后台管理系统很慢
  • 郑州 网站建设公司制作电商网站
  • 长丰县重点工程建设管理局网站邯郸网站建设在哪里
  • 免费网站制作平台下载中国八冶建设集团网站
  • 汕头网站建设模板制作葛洲坝机电建设有限公司网站
  • 济南的网站建设公司wordpress地址怎么打开
  • 域名 备案 没有网站济南seo整站优化招商电话
  • 唐山制作网站公司网络组网方案
  • 齐博企业网站昆山建设局网站表格下
  • 长沙网站建设公司哪家好合肥建设网站制作哪个好
  • 网站制作哪里好重庆网站制作济南
  • wordpress微博登陆不了seozhun
  • html做网站自适应宽度做wordpress模板赚钱
  • 郑州公司建站模板苏州建设职业培训中心
  • wordpress零基础建站教程郑州做网站的公司msgg
  • dede 手机网站插件微信加精准客源软件
  • wordpress 软件站主题网店网站设计
  • 建站点怎么做网站如何评价一个网站设计的好坏
  • 深圳网站建设_请到中投网络沧州手机网站建设
  • 沈阳市建设监理协会网站门户网站开发视频
  • 丹棱网站建设网页美工图片
  • 潍坊制作网站证书查询网免费查询
  • 南宁共建站章丘市网站建设seo
  • 网站建设无广告语网站开发工程师项目经验怎么写
  • html5做网站优势罗村网站制作