Nick Chapsas

Nick Chapsas

Hello everybody I’m Nick Chapsas and this is my KZread channel.

I messed up. I'm sorry.

I messed up. I'm sorry.

Пікірлер

  • @vmachacek
    @vmachacek38 минут бұрын

    I went back to use this, but how do you make it work with ICollectionFixture?

  • @MrMatthewLayton
    @MrMatthewLayton3 сағат бұрын

    In my view, removing the bang-bang operator was the right decision. The operator merely replaces a NullReferenceException with an ArgumentNullException, which adds limited value. Introducing an entirely new operator to address a single type of exception seems unnecessary. Consider a scenario where multiple parameters require validation: using the !! operator for one parameter and conventional exceptions for the others results in an inconsistency between exception handling and guard clause declarations. I find regular guard clauses to be more consistent and reliable. In my own projects, I have implemented methods that align with Kotlin's guard clauses, such as Check(), CheckNotNull(), Require(), and RequireNotNull().

  • @xlerb2286
    @xlerb22863 сағат бұрын

    As someone that's worked with accounting systems this is completely understandable. You never go back and change a value, even if it was in error. You can only add new transactions that modify the value . Everything is just a sequence of transactions that takes you from a starting balance to the current balance. (The starting balance is typically arrived at by closing the previous financial period where that prior set of transactions are either moved to history or, if the GAAP allows, discarded). We'd go about determining the value as of some point in time in a different way, but it's the same concept. An in-memory similar concept is a Hughes list. You never modify the starting empty list, you only build up a sequence of lambdas or similar that each take an input list and produce a new list that is modified in some way. Chained together they hold the sequence of modifications you want to make to that initial empty list. When those lambdas are executed they produce the final list. But the original list and all the intermediate lists are immutable, so you could branch from any of those lists, using it as a starting point for an alternate list.

  • @TheBadspeed
    @TheBadspeed3 сағат бұрын

    FINALLY THEY ADDED A TAG TO CACHE ITEMS, GOD BLESS YOU MICROSOFT

  • @impeRAtoR28161621
    @impeRAtoR281616213 сағат бұрын

    Does in have "automatic" population after some time like old .NET frameworks MemoryCache had with its callbacks?

  • @josephhungerman1056
    @josephhungerman10564 сағат бұрын

    Any chance you can do a video on deploying Aspire with Azure Devops pipelines? The official docs seem off

  • @jimread2354
    @jimread23544 сағат бұрын

    I love that you referred to the IDistributedCache as "yucky" 💚

  • @greggwonderly7173
    @greggwonderly71734 сағат бұрын

    This is largely what Java's Jini platform provided 30 years ago. Here we once again see the masses suddenly feeling like Microsoft is innovating when all they are doing is copying what's already been known, has been done before, and is known computer science. But, since everyone has been just using whatever MS provides, they've been locked out of being this productive for decades already.

  • @fernandovictor82
    @fernandovictor825 сағат бұрын

    This isn't the same concept of partial class?

  • @Marcel-dt5du
    @Marcel-dt5du6 сағат бұрын

    Is this available in preview already?

  • @CarmenSantiNova
    @CarmenSantiNova6 сағат бұрын

    Ok, HybridCache seems like a good addition to the collection of cache implementations. But one thing that I don't like about it is that it don't have a factory solution where I can specify a cache create / refresh method centrally. Much like the IConfiguration provider solution. The problem arises when I want to reuse the same cached value in multiple places. I then have to specify the factory in multiple places...

  • @afouadr
    @afouadr6 сағат бұрын

    IMHO: HybridCache looks like the way moving forward, but please also mark IMemoryCache and IDistributedCache [Obsolete] and whatever jargon made into BCL with .NET 9 Release and completely remove both of these APIs in .NET 10. The BCL Team may consider using the [Obsolete] attribute more aggressively between alternating .NET Releases - keep the BCL clean and tidy. PLEASE!!!

  • @jesusdelarua5995
    @jesusdelarua59957 сағат бұрын

    Where can I find the source code for this video DEMO? Thank you.

  • @ivandrofly
    @ivandrofly7 сағат бұрын

    Very interesting

  • @rafamodd
    @rafamodd7 сағат бұрын

    I use IOutputCache with an extensions to support redis, so in this scenario between hybrid and ioutputcache you can go either way, however i heavly tested the ioutputcatch and seems to be pretty fast too!

  • @allinvanguard
    @allinvanguard7 сағат бұрын

    Did they just embrace, extend and extinguish FusionCache? 😂

  • @HHJ79
    @HHJ794 сағат бұрын

    The maintainer of FusionCache is actively participating in the design discussions regarding HybridCache.

  • @allinvanguard
    @allinvanguard4 сағат бұрын

    @@HHJ79 That's great to know - This hasn't always happened with previous things embedded in the Framework. But in that case I'm very happy to see it embraced.

  • @jodydonetti
    @jodydonetti3 сағат бұрын

    FusionCache creator here: eh, I hear you, you’re not the first one to tell me that 😅 I’m sharing my experiences and design ideas with the team, and they are listening! I even suggested the name HybridCache, the previous name was not that clear imho (naming is hard). I hope the two will be able to work together in the end, with HybridCache as a potential shared abstraction.

  • @SacoSilva
    @SacoSilva7 сағат бұрын

    12:00 Distributed cache*

  • @andrzejbakun3692
    @andrzejbakun36927 сағат бұрын

    Looks great, but I _really_ dislike the magic registration, when HybridCache detects automatically what type of distributed cache is registered. If you know, sure, easy, however if you find yourself in a project without that knowledge, there is "no breadcrumb" to lead you on to what is really happening. Feels like unnecessary bar rising for less experienced developers or less lucky to be around when this feature is being advertised... Still, looking forward to take it for a spin :)

  • @kamushekdev
    @kamushekdev8 сағат бұрын

    Why isn't there a Get method. What should I do to just check is something in cache?

  • @jodydonetti
    @jodydonetti3 сағат бұрын

    That has been left out from preview 4, will probably be in preview 5.

  • @letsplay1122
    @letsplay11228 сағат бұрын

    This is amazing, just what I needed!

  • @rakaboy1619
    @rakaboy16198 сағат бұрын

    so is this just traits

  • @xlerb2286
    @xlerb22868 сағат бұрын

    The only time I've seen a List<object> used was someone had set up a list of objects to use as sync roots, one per unique thread id. Yes, I know, that's all kinds of bad. That was a fun little job unsnarling that code. As for the whole IDisposable mess Eric Lippert said IDisposable was the 2nd worst mistake in C#. I think he's underrated it ;)

  • @denissmith8282
    @denissmith82828 сағат бұрын

    It's cloudy, what a surprise

  • @Esgarpen
    @Esgarpen8 сағат бұрын

    My issue here is that we are cache:ing null for N minutes if we get a bad-request... but assuming you handle that, I think this new cache could be very helpful - especially with db-lookups or external API-calls

  • @T___Brown
    @T___Brown9 сағат бұрын

    Can you clarify? If a different request for weather comes in... does it still block? Or is the blocking purely based upon the cache key?

  • @Biker322
    @Biker3229 сағат бұрын

    Yay I can get ride of all the semaphoreslims

  • @TheWolverine1984
    @TheWolverine19849 сағат бұрын

    Can you do a video about how to debug applications that run on docker/kubernetis?

  • @astralpowers
    @astralpowers9 сағат бұрын

    I hope this supports dot et 8 so I can use it at work

  • @joepurdom2528
    @joepurdom25289 сағат бұрын

    Implicit extension seems incredibly useful and should produce cleaner/more readable code. However, very curious about the explicit extension and how it differs from using inheritance or explicit cast operators. Also feels like this will allow developers to circumvent sealed classes which seems dangerous. Looking forward to in-depth video once this all solidifies.

  • @SajadJalilian
    @SajadJalilian10 сағат бұрын

    He is making "dometrain"; the "frontendmasters" for .NET. NIce

  • @DlinnyLag
    @DlinnyLag10 сағат бұрын

    One more solution with implicit dependency. There is no declaration that says - HybridCache functionality depends on Redis. MS need to change this as it done in many cases already.

  • @gt10i
    @gt10i4 сағат бұрын

    I agree. Avoiding lots of setup code is nice, but it should not be abstracted to the point where things become magic, and you just have to "know" about it. Would have preferred if there was an explicit statement "use Redis" while setting up HybridCache.

  • @Albi91vl
    @Albi91vl10 сағат бұрын

    This is the best ever thing Microsoft has released in the past 2 years. Only if this was released like 6 months ago when I needed something similar. Was a pain in the ... to build this kind functionality

  • @da3dsoul
    @da3dsoul10 сағат бұрын

    I was dealing with this problem last week. Excited for .net 10 when I can use it lol

  • @wboumans
    @wboumans10 сағат бұрын

    RemoveByTag distributed is killer, finally.

  • @ismailosman5048
    @ismailosman504811 сағат бұрын

    List<object> ....... Never

  • @urbanelemental3308
    @urbanelemental330811 сағат бұрын

    1) Synchronization of requests for any memory cache can be handled easily by inserting a Lazy<Task<T>>. The Lazy minimizes (or even eliminates) the chance of opportunistic concurrency, and the Task is the actual request that gets made and shared. Sure, you have to do some smart eviction if either of those fail, but IMO, I think this kind of operation should have be built in to (or provided as an extension) any memory cache. 2) I would always have a short term expiry in memory cache for anything that is cache-able. Ideally tuned with a short term sliding expiry that still honors an absolute. Then of course, the distributed cache API would be the next layer that the in memory cache calls to. 3) Either way, each cache layer should have an option to use pessimistic concurrency. AKA "stampede protection" should be an option for both, and IMO, its should be the default.

  • @gunnarliljas8459
    @gunnarliljas845910 сағат бұрын

    1) Sure, could work, but only in a GetOrAdd scenario, where immediate invocation of the Lazy is guaranteed. 2) Yes, we have that, with an option to have in memory cache invalidation using Redis PubSub.

  • @dmitryevmenov8298
    @dmitryevmenov829811 сағат бұрын

    I think that's an awesome one! Looking into the docs/options, it's not clear to me whether it behaves in a multi-layer manner, or whether it is an option that you can switch on. I.e., if I want the cache to first try to grab a value from the local (IMemoryCache) cache, and then if not found - go to the shared (IDistributed) one, and once found or refreshed - update the local cache entry back. I used to build something like this to reduce some redis calls. Of course this comes with a cost of extra delay for the updated value to get it to the consumers, however, if configured the TTL properly for both shared and local caches, might be worth it for some scenarios. So, is this now achievable out-of-the-box with the new HybridCache thing?

  • @dinov5347
    @dinov534712 сағат бұрын

    This is why you shouldn't directly code to the M$ interfaces. You should always wrap them within your own interface and call the MS implementation from your own implementation so you can swap them out at will without changing your client code.

  • @SayWhaaaaaaaaaaaaaaaaaaaaaaat
    @SayWhaaaaaaaaaaaaaaaaaaaaaaat12 сағат бұрын

    MS SHOULD SLOW DOWN WITH NEW .NET VERSIONS!! EVERY 2 WEEKS NEW VERSIO

  • @SvnVasiliy
    @SvnVasiliy12 сағат бұрын

    Why did they choose to make it an abstract class instead of interface?

  • @rafamodd
    @rafamodd7 сағат бұрын

    Is almost the same, the benefitial is that in an abstract class you can opt to override implementations instead of extending an "option or builder" class that you then have to override implementation

  • @jodydonetti
    @jodydonetti3 сағат бұрын

    To ease evolvability in the future: with interfaces they can’t add new stuff without breaking existing implementations, whereas with an abstract class they can provide a default implementation.

  • @immortallman3482
    @immortallman348212 сағат бұрын

    Is this code avaiable on github?

  • @BomberJJ
    @BomberJJ12 сағат бұрын

    I manually implemented something similar to HybridCache, but it was impossible to do proper Cache Invalidation. You can clear the distributed cache, you can clear the current instance's local cache, but you can't clear a different instance's local cache. This meant we had to use a plain distributed cache if the use case required cache invalidation. Fortunately most use cases don't need it.

  • @Albi91vl
    @Albi91vl10 сағат бұрын

    But this doesn't cache locally (if distributed is used) from what I understood. The name comes from the fact that uses local cache or distributed cache with the same interface. I think it just uses distributed locks for a specific resource (key) and interacts with the distributed cache back and forth multiple times for acquiring the lock for the specific resource and then changing the resource and then releasing the lock. The lock itself is an entry in Redis with the resource id as key and the unique instance id as value.

  • @KerchumA222
    @KerchumA2228 сағат бұрын

    you can implement distributed invalidation using pub/sub or similar. I like the idea of tiered caching as long as there are sane defaults and plenty of options to customize when needed.

  • @jodydonetti
    @jodydonetti7 сағат бұрын

    Take a look at FusionCache, it does that already (shameless plug)

  • @gp5381
    @gp538112 сағат бұрын

    you miss, rust, F# (.net), ocaml, wdyt of them? they are beautiful and useful language languages

  • @izzyblackout1090
    @izzyblackout109012 сағат бұрын

    What happen if, during the GetCreate cache, the API request fails? Will it caches the bad response or will it ignores it? I think this is quite common case, where normally you would end up with all incoming requests receive cached bad response

  • @justinassakalavicius4465
    @justinassakalavicius446512 сағат бұрын

    Great video - amazing content. Thank you !

  • @kittakornkraikruan8224
    @kittakornkraikruan822412 сағат бұрын

    thanks

  • @xeus
    @xeus12 сағат бұрын

    I thought about trying this out for myself, but apparently I am missing something. Are there any instructions on how can I get this feature working on my own computer? As a professional software developer I would be very much interested in playing with pre-preview features in order to have cutting edge knowledge of C# and .NET. I have .NET 9 preview 4 installed, and I am using "preview" as my language version, but I couldn't get this to work. After some furious research I found out that apparently this feature is not yet in the main branch of the csharplang repo nor the roslyn repo, but still only in the roles branch in the former repo.

  • @asksearchknock
    @asksearchknock13 сағат бұрын

    Redis… 😮 oh no …. No no… 😂

  • @Petoj87
    @Petoj8713 сағат бұрын

    Does this work if you hit multiple instances of the application? or would each of them run the request to the weather api?

  • @nickchapsas
    @nickchapsas12 сағат бұрын

    If you add the distributed cache it will use that for every app

  • @Petoj87
    @Petoj878 сағат бұрын

    @@nickchapsas that I understand, but my question was more about if the flood protection would synchronize between multiple instances of the application or if there is a small window where multiple requests could go off (one per instance)

  • @ShowoffFantasy
    @ShowoffFantasy13 сағат бұрын

    Syntactic sugar for ConcurrentDictionary<string, SemaphoreSlim>. Nice!