"use strict";(self.webpackChunkspotify_api_docs=self.webpackChunkspotify_api_docs||[]).push([[8494],{3905:function(e,t,r){r.d(t,{Zo:function(){return u},kt:function(){return d}});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),p=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},u=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},y=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),y=p(r),d=a,f=y["".concat(s,".").concat(d)]||y[d]||c[d]||o;return r?n.createElement(f,i(i({ref:t},u),{},{components:r})):n.createElement(f,i({ref:t},u))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=y;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var p=2;p HandleRetry(IRequest request, IResponse response, IRetryHandler.RetryFunc retry)\n {\n // request is the sent request and response is the received response, obviously\n\n // don't retry:\n return response;\n\n // retry once:\n var newResponse = retry(request);\n return newResponse;\n\n // use retry as often as you want, make sure to return a response\n }\n}\n")),(0,o.kt)("h2",{id:"simpleretryhandler"},"SimpleRetryHandler"),(0,o.kt)("p",null,"A ",(0,o.kt)("inlineCode",{parentName:"p"},"SimpleRetryHandler")," is included, which contains the following retry logic:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Retries the (configurable) status codes: 500, 502, 503 and 429."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"RetryAfter")," - Specifies the delay between retried calls."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"RetryTimes")," - Specifies the maxiumum amount of performed retries per call."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"TooManyRequestsConsumesARetry"),' - Whether a failure of type "Too Many Requests" should use up one of the retry attempts.')),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-csharp"},"var config = SpotifyClientConfig\n .CreateDefault()\n .WithRetryHandler(new SimpleRetryHandler() { RetryAfter = TimeSpan.FromSeconds(1) });\n\nvar spotify = new SpotifyClient(config);\n")))}d.isMDXComponent=!0}}]);