DavidAJohn / FotoStorio

Blazor WebAssembly application for a fictional photography store, with Stripe Elements payment integration and styling with Tailwind CSS.
MIT License
5 stars 1 forks source link

Add new .NET Http Resilience #26

Closed DavidAJohn closed 4 months ago

DavidAJohn commented 11 months ago

In .NET 8, Microsoft have added new libraries which enhance an application's resilience using Polly as their backbone.

These new libraries are explained by Martin Tomka here: Building resilient cloud services with .NET 8

FotoStorio doesn't currently implement Polly, so let's try out the new resilience libraries instead. It seems to be as simple as adding a service handler to the build process in the Program.cs - so pretty much like Polly.

Martin also did a demo at .NET Conf 2023: https://www.youtube.com/watch?v=BDZpuFI8mMM

DavidAJohn commented 11 months ago

I don't know what made me think the application didn't implement Polly - perhaps I was mistakenly looking at the Server project's Program.cs class.

Of course it uses Polly.

There's a negligible increase in performance but the new libraries do use about 4x less memory, so still worth implementing it.

DavidAJohn commented 11 months ago

There's also a .NET Rocks podcast about the release of Polly v8: https://www.dotnetrocks.com/details/1875