You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a big fan of this library, and I'm glad that there's a .NET solution for web push.
I was looking through the source code, and I noticed an easy to stumble into code smell in the SendNotification implementation: a new HttpClient is created for each notification sent.
Thank you for the great feedback @nikmd23, I was unaware of this!
I'm now using a shared instance pf HttpClient within my class which doesn't "solve" the issue however it allows the user to hold a static instance to my class which resolves the issue.
Does this fix the issue for you?
I wasn't too keen to store an HttpClient object after my class was disposed just in case i need it again.
PS - I'm in the middle of recording a Pluralsight course on WebPush. In it, I'm both using and recommending your library! It worked great and was just what I needed.
Hello!
I'm a big fan of this library, and I'm glad that there's a .NET solution for web push.
I was looking through the source code, and I noticed an easy to stumble into code smell in the
SendNotification
implementation: a newHttpClient
is created for each notification sent.There's a good article explaining why this is bad, and how to fix it.
The text was updated successfully, but these errors were encountered: