Priekš kam mākslīgi taisīt bildes, kā izskatījies 80os, ja var atbraukt 26.septmebrī uz Padures muižu un izskatīties!
Biļetes vēl pagaidām ir https://t.co/rf2mEn9CmR
@laacz Man arī ir Dreame X50 ultra, (dreame_vacuum_r2489b) ja darbu iedot izdara, bet vislielākās problēmas ir ar pašu aplikāciju, visādi gļuki un manuprāt no ux perspektīvas daudz kas nepārdomāts. Man nesanāk arī pieslēgt pie home assistant. Un izrādās tas ir ļoti saistīts ar xiaomi.
@AigarsSukurs Es izmantoju Debian 13 ar k3s packagiem un longhorn priekš disku managment. Tīklam izmantoju wireguard, lai pieslēgtos pie clustera un tas arī viss. Bet visi kas grib mēģināt noteikti pareizā secībā jāapgūst lietas, sākumā Linux, tad docker un tikai tad kubernetes.
@AigarsSukurs Es principā visus savas virtuālās mašīnas kur man ir visādas web lapas pārnesīšu uz k3s rancher. Jau ir tik daudz plusi, kā piemēram pārnest no vienas valsts serveriem uz citu, tikai ar vienu yaml rindiņu, kā arī monitorings prometheus grafana. Nav vairs jāmin kur atrodas app.
There is a problem with HttpClient 80% of developers...
Don't know about 👇
You call external APIs in almost every project.
⛔ Many devs just use one Singleton HttpClient for all HTTP calls.
And they are completely wrong.
Singleton HttpClient doesn't resolve 𝗗𝗡𝗦 𝗮𝗻𝗱 𝗻𝗲𝘁𝘄𝗼𝗿𝗸 𝗰𝗵𝗮𝗻𝗴𝗲𝘀. I encountered an issue where an internet provider network failure caused my application to stop sending HTTP requests until it was restarted.
⛔ Maybe we can just create an HttpClient for each call with a using statement?
This is the second common mistake. Sooner or later, you can get a 𝗣𝗼𝗿𝘁 𝗘𝘅𝗵𝗮𝘂𝘀𝘁𝗶𝗼𝗻 problem. As disposed, HttpClient doesn't immediately free up the used Socket under the hood.
Let's explore the 3 ways to use HttpClient correctly:
☑️ HttpClientFactory with Named Client
☑️ HttpClientFactory with Typed Client
☑️ HttpClientFactory with Refit library
HttpClientFactory contains a pool of HttpClients and caches them. Each time you need an HttpClient, you resolve it from the Factory.
𝗣𝗿𝗼𝘀:
• Solves DNS refresh & socket exhaustion
• Central place to configure default policies
• Lightweight, part of Microsoft.Extensions.Http
𝗖𝗼𝗻𝘀:
• You need to write boilerplate code to resolve HttpClient before sending each request
• You still pass raw URLs & strings around
𝗧𝘆𝗽𝗲𝗱 𝗛𝘁𝘁𝗽𝗖𝗹𝗶𝗲𝗻𝘁 — you register a named class that gets an HttpClient injected in the constructor. You encapsulate all the message-sending logic in this class.
Your business code calls the strongly‑typed service instead of using HttpClientFactory, URLs and request/response serialization directly in the calling code.
𝗣𝗿𝗼𝘀:
• Encapsulates endpoints in one class
• Strong typing & DI‑friendly
• Easy unit‑testing with mocks / handlers
𝗖𝗼𝗻𝘀:
• Manual mapping between DTOs & endpoints
• Much boilerplate code
𝗥𝗲𝗳𝗶𝘁 — Refit turns your C# interface into a strongly‑typed REST client at runtime.
𝗣𝗿𝗼𝘀:
• No boilerplate code for REST calls
• Interface‑first design, clear contracts
𝗖𝗼𝗻𝘀:
• Adds third‑party dependency
How do you manage HttpClient in your projects: HttpClientFactory, Typed Clients, or Refit? Leave a comment down below 👇
——
♻️ Repost to help others learn about problems with HttpClient
➕ Follow me ( @AntonMartyniuk ) to improve your .NET and Architecture Skills
@laacz Tu ONVIF neēsi mēģinājis? No chatgpt > Most IP cameras that expose motion, person detection, sound, light-level, and other events to Home Assistant do so through the ONVIF Events protocol.
@AigarsSukurs Jā tieši tas man arī patīk OBS, es mūsu beidzamajā #DiscoNakts tiešstraumē izveidoju uzrakstos (lower third) ar html, css, js https://t.co/zbzwAp9tmx
@AigarsSukurs@lordramex Bet tas ir tikai loģiski ka sākumā vajag izstrādātāju, kā jebkuram softam. Tām lielajām programmām ko minēji tāpat ir visu būvējuši programmētāji. Uzskatu ka native desktop programmas drīzumā tiks aizstātas ar Web versijām un var jau redzēt ka viņi arī piedāvā cloud.