{"id":24838770,"url":"https://github.com/reacture/khala.transientfaulthandling","last_synced_at":"2025-10-08T01:26:05.179Z","repository":{"id":65414268,"uuid":"101500905","full_name":"Reacture/Khala.TransientFaultHandling","owner":"Reacture","description":"Transient fault handling","archived":false,"fork":false,"pushed_at":"2018-03-18T09:20:27.000Z","size":94,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-01T21:49:09.231Z","etag":null,"topics":["retry-policy","transient-fault-handling"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Reacture.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-26T17:14:28.000Z","updated_at":"2023-07-19T00:56:54.000Z","dependencies_parsed_at":"2023-01-23T10:55:11.397Z","dependency_job_id":null,"html_url":"https://github.com/Reacture/Khala.TransientFaultHandling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Reacture/Khala.TransientFaultHandling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reacture%2FKhala.TransientFaultHandling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reacture%2FKhala.TransientFaultHandling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reacture%2FKhala.TransientFaultHandling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reacture%2FKhala.TransientFaultHandling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Reacture","download_url":"https://codeload.github.com/Reacture/Khala.TransientFaultHandling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reacture%2FKhala.TransientFaultHandling/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267598825,"owners_count":24113668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["retry-policy","transient-fault-handling"],"created_at":"2025-01-31T06:21:47.718Z","updated_at":"2025-10-08T01:26:00.132Z","avatar_url":"https://github.com/Reacture.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Khala.TransientFaultHanding\n\n일시적 실패에 대한 일반화된 재시도 정책 구현체입니다.\n\n```csharp\npublic Task\u003cHttpResponseMessage\u003e SendHttpRequestWithRetryPolicy(\n    HttpClient httpClient,\n    HttpRequestMessage request,\n    CancellationToken cancellationToken)\n{\n    // 최대 재시도 횟수\n    int maximumRetryCount = 5;\n\n    // 일시적 실패 감지 전략\n    var transientFaultDetectionStrategy =\n        new DelegatingTransientFaultDetectionStrategy\u003cHttpResponseMessage\u003e(\n            exception =\u003e true,\n            response =\u003e response.IsSuccessStatusCode == false);\n\n    // 재시도 지연 전략\n    var retryIntervalStrategy =\n        new LinearRetryIntervalStrategy(\n            initialInterval: TimeSpan.Zero,\n            increment: TimeSpan.FromMilliseconds(500),\n            maximumInterval: TimeSpan.MaxValue,\n            immediateFirstRetry: false);\n\n    // 재시도 정책\n    var retryPolicy = new RetryPolicy\u003cHttpResponseMessage\u003e(\n        maximumRetryCount,\n        transientFaultDetectionStrategy,\n        retryIntervalStrategy);\n\n    // 재시도 정책을 통한 HTTP 요청\n    return retryPolicy.Run(\n        httpClient.SendAsync,\n        request,\n        cancellationToken);\n}\n```\n\n## 설치\n\n```text\nPM\u003e Install-Package Khala.TransientFaultHandling\n```\n\n## 재시도 정책 구성\n\n재시도 정책은 다음 3가지 요소로 구성됩니다.\n\n|요소|설명|\n|--|--|\n|최대 재시도 횟수|연산이 실패할 때 최대로 재시도 할 횟수입니다.|\n|일시적 실패 감지 전략|연산 실행중 발생한 예외나 반환 값이 일시적 실패인지 판단합니다.|\n|재시도 지연 전략|일시적 실패 후 다시 연산 재실행을 지연시킬 시간을 결정합니다.|\n\n## 반환 값을 가지지 않는 비동기 연산에 대한 재시도 정책\n\n`Khala.TransientFaultHandling.RetryPolicy` 클래스가 반환 값을 가지지 않는 비동기 연산에 대한 재시도 정책을 구현합니다.\n\n```csharp\npublic class RetryPolicy\n{\n    public RetryPolicy(\n        int maximumRetryCount,\n        TransientFaultDetectionStrategy transientFaultDetectionStrategy,\n        RetryIntervalStrategy retryIntervalStrategy);\n\n    public virtual Task Run(\n        Func\u003cCancellationToken, Task\u003e operation,\n        CancellationToken cancellationToken);\n\n    public virtual Task Run\u003cT\u003e(\n        Func\u003cT, CancellationToken, Task\u003e operation,\n        T arg,\n        CancellationToken cancellationToken);\n}\n```\n\n## 반환 값을 가지는 비동기 연산에 대한 재시도 정책\n\n`Khala.TransientFaultHandling.RetryPolicy\u003cTResult\u003e` 클래스가 반환 값을 가지는 비동기 연산에 대한 재시도 정책을 구현합니다.\n\n```csharp\npublic class RetryPolicy\u003cTResult\u003e\n{\n    public RetryPolicy(\n        int maximumRetryCount,\n        TransientFaultDetectionStrategy\u003cTResult\u003e transientFaultDetectionStrategy,\n        RetryIntervalStrategy retryIntervalStrategy);\n\n    public virtual Task\u003cTResult\u003e Run(\n        Func\u003cCancellationToken, Task\u003cTResult\u003e\u003e operation,\n        CancellationToken cancellationToken);\n\n    public virtual Task\u003cTResult\u003e Run\u003cT\u003e(\n        Func\u003cT, CancellationToken, Task\u003cTResult\u003e\u003e operation,\n        T arg,\n        CancellationToken cancellationToken);\n}\n```\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2017 Gyuwon Yi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freacture%2Fkhala.transientfaulthandling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freacture%2Fkhala.transientfaulthandling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freacture%2Fkhala.transientfaulthandling/lists"}