![]() ![]() First of all, it’s considered good practice to do so. Really any object which has external resources that must be clean up uses the IDisposable interface.Īnd you can’t be blamed for wanting to wrap it with the using. NET and we use it for everything from database connections to stream writers. The dispose method is called and whatever resources are in use are cleaned up. Once the using block is complete then the disposable object, in this case HttpClient, goes out of scope and is disposed. The using statement is a C# nicity for dealing with disposable objects. The typical usage pattern looked a little bit like this: using( var client = new HttpClient()) ![]() NET language then chances are you’ve made use of HttpClient. If the microservies are built in C# or any. There are many options for communicating, but HTTP is an ever popular option. As more services are added and monoliths are broken down there tends to be more communication paths between services. ![]() Microservices can be a bear to deal with. My site was unstable and my clients furious, with a simple fix performance improved greatly and the instability disapeared.Īt the same time I actually improved the performance of the application through more efficient socket usage. I’ve been using HttpClient wrong for years and it finally came back to bite me. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |