| @@ -18,5 +18,6 @@ namespace GrpcShared.Interfaces | |||
| Task<SingleTrackResponse> ListSingleTrackAsync(SingleTrackRequest request); | |||
| Task<MultipleTrackResponse> ListMultipleTrackAsync(MultipleTrackRequest request); | |||
| Task SaveTracks(SaveTracksRequest request); | |||
| Task<Microsoft.AspNetCore.Components.Authorization.AuthenticationState> GetAuthenticationStateAsync(); | |||
| } | |||
| } | |||
| @@ -19,7 +19,6 @@ | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <ProjectReference Include="..\gRPCServer\SpotifyService.csproj" /> | |||
| <ProjectReference Include="..\GrpcShared\GrpcShared.csproj" /> | |||
| <ProjectReference Include="..\NemAnCore\NemAnBlazor.csproj" /> | |||
| </ItemGroup> | |||
| @@ -1,7 +1,7 @@ | |||
| @inherits LayoutComponentBase | |||
| <div class="page"> | |||
| <div class="sidebar"> | |||
| <div style="background: green ;" class="sidebar"> | |||
| <NavMenu /> | |||
| </div> | |||
| @@ -30,7 +30,15 @@ builder.Services.AddHttpClient("HttpClient", c => | |||
| }) | |||
| .SetHandlerLifetime(TimeSpan.FromMinutes(5)) | |||
| .AddPolicyHandler(GetRetryPolicy()) | |||
| .AddPolicyHandler(GetCircuitBreaker()); | |||
| .AddPolicyHandler(GetCircuitBreaker()) | |||
| .AddPolicyHandler(GetBulkheadPolicy(50,200)); | |||
| IAsyncPolicy<HttpResponseMessage> GetBulkheadPolicy(int capacity, int queueLength) | |||
| { | |||
| //As soon as we hit 50 concurrent requests, the policy will add subsequent requests to the pending request queue. | |||
| //Once the pending request queue is full, then the policy will start rejecting any other calls to the service. | |||
| return Policy.BulkheadAsync<HttpResponseMessage>(capacity, queueLength); | |||
| } | |||
| IAsyncPolicy<HttpResponseMessage> GetCircuitBreaker() | |||
| { | |||
| @@ -22,6 +22,7 @@ | |||
| <ItemGroup> | |||
| <ProjectReference Include="..\GrpcShared\GrpcShared.csproj" /> | |||
| <ProjectReference Include="..\IdentityProvider\IdentityProvider.csproj" /> | |||
| <ProjectReference Include="..\NemAnCore\NemAnBlazor.csproj" /> | |||
| </ItemGroup> | |||