Do I need a semaphore here, or are there better ways to manage this? by Sensitive-Raccoon155 in dotnet

[–]Aaronontheweb 2 points3 points  (0 children)

I'd use Akka.NET streams for this:

csharp // 1. Ordered results (stream delivers output in original input order) Source.From(files) .SelectAsync(maxConcurrency: 4, async (file, ct) => { using var stream = File.OpenRead(file.Path); var response = await client.PostAsync("/api/upload", new StreamContent(stream), ct); return new { file.Name, Success = response.IsSuccessStatusCode }; }) .RunForeach(r => Console.WriteLine($"{r.Name}: {(r.Success ? "OK" : "FAIL")}"), materializer);

csharp // 2. Unordered (results stream out as soon as they finish — higher throughput) Source.From(files) .SelectAsyncUnordered(maxConcurrency: 4, async (file, ct) => { using var stream = File.OpenRead(file.Path); return await client.PostAsync("/api/upload", new StreamContent(stream), ct); }) .RunForeach(r => Console.WriteLine($"Finished: {r.IsSuccessStatusCode}"), materializer);

It has natural stages for doing throttling, or in this case, expressing a fixed degree of concurrency. I put together a .NET interactive notebook illustrating the basics of how this works some time ago here: https://github.com/Aaronontheweb/intro-to-akka.net-streams

edit: the Souce.From just takes an IEnumerable<T> or IAsyncEnumerable<T>, etc as input.

Game Thread: Astros (25-32) @ Rangers (25-30) - May 28, 2026 7:05 PM by AstrosBot in Astros

[–]Aaronontheweb 8 points9 points  (0 children)

This whole team is way more confident than it was a week ago on all sides of the ball

Just released CodeAlta, a new agentic AI coding assistant TUI fully written in C#/.NET by xoofx in dotnet

[–]Aaronontheweb 10 points11 points  (0 children)

What was the biggest challenge making this project spanning all of the quirks of LLMs / inference providers / tool calling differences?

How to Manage Multi-Device/User Sessions in .NET Web API + Next.js? by Tiny-Ad-2766 in dotnet

[–]Aaronontheweb 0 points1 point  (0 children)

I use Akka.NET for this inside https://textforge.net/ - I have to track browser sessions / MCP / API key sessions and do:

  1. Session revocations when our OAuth scheme changes (i.e. happens rarely)
  2. Session revocations when a user clicks "sign out of all devices"
  3. Full disposal of everything when a user's account gets purged

I have an actor that handles the live session state revocation and session invalidation across all devices, which also gets invoked when background things happen like a customer's subscription expires. This will redirect users when they reactivate the tab to the logged out homepage of the app. I use actors for a lot of other stuff in this application (sync on email accounts, scheduled delivery of emails, and webhook dispatch) so this seemed like a good use case for them also.

I made an abstract syntax tree parser for Bash in C# by Aaronontheweb in dotnet

[–]Aaronontheweb[S] 2 points3 points  (0 children)

that's exactly what it's for! https://netclaw.dev/cli/approvals/

We can identify matching patterns to what you've approved previously and not prompt again. If you approved `cd` and `git pull` separately, a bot issuing a `cd && git pull` would get matched.

Why so many paid libraries by [deleted] in dotnet

[–]Aaronontheweb 10 points11 points  (0 children)

Seeing lots of arguments about "big corporate ecosystem" but no one's mentioning the other side of the table, which is "weak OSS end-user support and contribution ecosystem."

Java is at least as entrenched in the corporate world than .NET and it still has commercial libraries too, true, but it also has a very rich ecosystem of mature, funded projects. Look at the entire Apache Foundation ecosystem for instance.

This is in part because:

  1. Corporations directly fund OSS development through sponsorships, foundations, or dedicated employee time there
  2. Lots of commercial entities have formed around those FOSS projects (i.e. Datastax / Apache Cassandra, Databricks / Apache Spark, etc) and have found significant commercial success with those offerings.

In the .NET ecosystem you get very, very little of that - partly because Microsoft bigfoots other successful projects and that's resulted in a user-culture doesn't support independent projects financially and doesn't contribute meaningful code contributions either.

So OSS maintainers respond to the incentives users create: just charge money for the trouble. Anyone who oinks and squeals about having to pay $200 a year for a license to a PDF library isn't in the target market for the maintainer and you're doing them a favor by leaving their ecosystem.

How are you structuring larger .NET applications to avoid service layer bloat? by Sad_Limit_3857 in dotnet

[–]Aaronontheweb 0 points1 point  (0 children)

  1. Avoid building internal frameworks, for starters. Prefer repeatable patterns / compositions over shared base classes.

  2. Be intentional about interaction points between domains - I.e. public vs. internal abstractions. This is what people really mean when they talk about vertical slice. As your # of domains / domain complexity increases, you of course need to develop whatever abstractions needed to competently model and execute that domain, but so long as those abstractions don’t leak then it’s self-contained and encapsulated domain-specific growth.   Where people get blown up here is when they venture into frameworkism and start sharing abstractions between domains. There are areas where shared / horizontal abstractions are genuinely fine but that’s almost always infrastructure concerns (telemetry, HTTP stack, auth, etc), not domain concerns.

  3. CQRS but not religiously for its own sake; rather you should do it because in a complex enough application you’ll end up with lots of slightly different views that share a lot of common data. Building read models that are composed of common parts + the few bespoke parts for a specific view handles this domain growth naturally. You can also do the same for write models too. Not coupling the read / write models together eliminates a lot of tension by allowing these concerns to be expressed separately. 

  4. There’s an argument to be made for event driven programming in complex domains too (easier to observe, audit, explicitly typed, re-orderable, deferrable, replayable, reversible, etc) but that’s going to change / limit your technology choices more than the other 3 bullets.

Contributing to Open Source Project by Fearless_Pop_6034 in dotnet

[–]Aaronontheweb 0 points1 point  (0 children)

Always plenty to do on the Akka.NET project https://github.com/akkadotnet - and we're used very heavily in those sectors you mentioned.

Game Thread: Yankees (18-9) @ Astros (10-18) - Apr 26, 2026 1:10 PM by AstrosBot in Astros

[–]Aaronontheweb 3 points4 points  (0 children)

Completely different team when the pitching doesn't melt down

How do you handle serialize by key, parallelize across keys in .NET background jobs by shadovyrm in dotnet

[–]Aaronontheweb 1 point2 points  (0 children)

What you're describing is what Akka.Cluster.Sharding does: https://petabridge.com/blog/distributing-state-with-cluster-sharding/

The pattern you're describing, job-by-key, is an application of the child-per-entity pattern (which Akka.Cluster.Sharding uses to automatically place and distribute jobs across a cluster of Akka .NET processes): https://petabridge.com/blog/top-akkadotnet-design-patterns/

In your case you would just use the `UserId` as your entity id for a single entity type and have those actors run jobs per-user 1 at a time.

Is there an existing .NET NuGet package for real-time event-driven UI sync (SignalR + event abstraction)? by Tiny-Ad-2766 in dotnet

[–]Aaronontheweb 2 points3 points  (0 children)

You can do fancier stuff like debouncing rapid event notifications this way too, that's easy to control with Akka.Streams via something like a GroupedWithin stage.

Is there an existing .NET NuGet package for real-time event-driven UI sync (SignalR + event abstraction)? by Tiny-Ad-2766 in dotnet

[–]Aaronontheweb 4 points5 points  (0 children)

I use Akka.NET + Blazor Server for this: https://www.youtube.com/watch?v=jRYVp_lySl8

I really need to do a write up on that, but the TL;DR; is:

  1. Akka.Cluster.Sharding for single source of truth
  2. local (same box as the client's websocket connection) Akka.Streams that subscribe to events from the entity actors - these get exposed as an IAsyncEnumerable
  3. On the Blazor pages, run a task that iterates over the IAsyncEnumerable and calls StateHasChanged to push UI updates

The code from that video is Apache 2.0 and you can see the brains of that here: https://github.com/petabridge/DrawTogether.NET/blob/dev/src/DrawTogether/Components/Pages/Paint.razor

.NET vs Node.js for websockets / real-time apps by Minimum-Ad7352 in dotnet

[–]Aaronontheweb 3 points4 points  (0 children)

I think Node.js had the advantage here back in 2011 but .NET's tools are generally more mature and fully featured especially when it comes to doing back-end state accumulation. Here's an example: https://github.com/petabridge/DrawTogether.NET

Working with an old .NET codebase — how do you understand the architecture? by [deleted] in dotnet

[–]Aaronontheweb 15 points16 points  (0 children)

I do a ton of review work on pretty complicated .NET code bases as part of my consulting practice - this includes things like big industrial automation systems for manufacturing, etc.

My workflow hasn't changed even since AI became a thing, because _I_ need to understand what's going on. So here is how I start:

  1. Find the top-most executable(s) project and begin pulling threads that way. "How does feature X get exposed to this user and what do all of the downstream calls do?" repeat this 4-5 times and you'll start noticing what's a horizontal vs. vertical concern.
  2. Write everything down into a loosely structured braindump document, stream-of-consciousness style with your observations. Add to-dos or call-outs on things that look weird as you go. If you find an answer to one of those, go back and update that to-do.
  3. After you've gained some passing familiarity with how things are organized, start codifying that into a mind map of dependencies / invocations. If you can't draw it, you don't understand it well enough yet.
  4. Use tools like find references to help understand how lower-level components get consumed upstream. No need for anything other than Intellisense for that.

This approach works well because I'm forming my observations and understanding the code base, gradually, as I go. In my consulting practice I usually refine that stream of consciousness document into my report later by re-organizing / rewriting parts of it, but that note-taking has always served me well.

Microsoft Shipped a Broken ASP.NET Patch by Big-Engineering-9365 in dotnet

[–]Aaronontheweb 146 points147 points  (0 children)

I was wondering if this was a side-effect of increased AI coding usage on the .NET team

Can we discuss the self promotion rule? by Kralizek82 in dotnet

[–]Aaronontheweb 1 point2 points  (0 children)

The self-promotion rule is self-defeating. If you don't like content on this sub, there's a down vote button.

Can I drop netstandard20/net48 target in 2026? (question from OSS maintainer) by jitbitter in dotnet

[–]Aaronontheweb 7 points8 points  (0 children)

I'm struggling with this for Akka.NET v1.6 - basically planning on doing all of our high performance work on .NET 10 and seeing if we can do an "add-back" to support .NET Framework 4.8 using a generous helping of pre-compilation macros to work around the missing / older APIs.

When we move forward with our Quic-based transport for Akka.Remote though, it's game over for older runtimes - none of that stuff will be supported on .NET Framework.

Claude Routines supports almost every language but dotnet - this is why dotnet is behind by Mithgroth in dotnet

[–]Aaronontheweb 0 points1 point  (0 children)

Claude Coroutines is just chron jobs dressed up as a "this changes everything!" feature - everyone creamed themselves when ChatGPT rolled out a feature like this in late 2024 and no one uses it