Every video I have watched is delivered as a chapter in the book. It has been a fantastic experience so far, so glad I have found this channel. Thank you!
@Petabridge16 күн бұрын
Glad you enjoy it!
@michaltomorowicz59618 күн бұрын
Good content, very informative! Thanks
@Petabridge16 күн бұрын
🙏
@NathanielElkins22 күн бұрын
Would be great if any future work on serialization using Polytype (or Typeshape) also made it relatively easy to use F# types. That would mean either not using source generators, or if you are using source generators, following the pattern of Orleans and allowing for annotation of F# types/assemblies with an attribute to generate the proper serializers.
@Petabridge20 күн бұрын
We plan to support F# users as first-class citizens on the new serialization tooling
@willemdrost9721Ай бұрын
Instead of using PipeTo, would it not be better to simply spawn a separate actor for each concurrent action? PipeTo seems very anti-pattern to me, it gives me the same vibes I get from the "friend" construction in C++ (where friends can touch your privates).
@StannardianАй бұрын
PipeTo is more like an integration between the TPL (Task) APIs and actors - it takes the results of a Task and lets it get piped back into the actor's mailbox like a normal IActorRef.Tell would. If you have a really long-running Task or if you want to run several of them all concurrently from the same actor, this pattern in combination with something like behavior switching allows the actor to still be responsive to additional messages while those tasks are running
@OttoGebbАй бұрын
Link to repo with the code of the demoed app?
@PetabridgeАй бұрын
We had it in the description but I'll post it here too! github.com/petabridge/DrawTogether.NET
@flyhighflyfastАй бұрын
best video on this matter!
@hermannboring2 ай бұрын
Great job fixing a .NET bug. This is quite rare indeed, not everyone can boast fixing a .NET bug. Usually, the .NET Team fixes most of .NET bugs. Can you post a link to the issue in .NET Runtime GitHub repo?
@hugebug4ever3 ай бұрын
Great stroy, learned a lot from the journey, thanks! One thing to clarify, in the conclusion page, I think the terminology "smoke test" shoud be rephrased to "Integration tests" or "auto test", as "smoke test" means specific to a test finish in a seconds or so.
@zkWarrior3 ай бұрын
Hello, I am new to actor systems and would like to ask a question. What are the best practices for handling database queries (synchronous or asynchronous) using actors? For example, when receiving an API endpoint request, I want the actor to go to the database and return a response message with the data. What is the best way to implement this?
@StannardianАй бұрын
Is the question on how to do the async / await portion of this or just how data access should look, generally, when using actors to facilitate this?
@zkWarriorАй бұрын
@@Stannardian Hi! This is more of a general question (although I'm not very familiar with the async / await or .PipeTo() part either). Should I just send messages that will be converted by the "database-handler" actor into plain asynchronous database queries? Is this the right way to do it?
@PetabridgeАй бұрын
@@zkWarrior I'd keep the db queries async and maybe put an actor in front of the query handler if you want to do things like limit the number of parallel database requests / open connections at any given time. The other reason for maybe having an actor responsible for this is so you can avoid having to spread DbContexts et al around to lots and lots of actors who might need database access. My $0.02
@zkWarriorАй бұрын
@@Petabridge Thanks for the reply! I'll try to experiment with that and maybe will check out some vids on the channel just to know more of the technical stuff.
@MrAdnan2524 ай бұрын
Out of curiosity, what does the "Props" type give you that a Func<TActor> parameter in ActorOf couldn't?
@Petabridge4 ай бұрын
A couple of things: 1. Props is meant to be serializable, so we actually take a NewExpression in the Props.Create so we can extract the individual CTOR arguments - this is necessary to support remote deployment of actors. That's kind of an edge case though - remote deployments are cool but not really super necessary. 2. Props can include some additional details needed to configure an actor - for instance, if you want to run an actor as a round-robin router pool of 5, use a custom mailbox (like a priority queue), or customize the dispatcher (i.e. have the actor run on the UI thread so it can manipulate a live chart) - those are all things you can specify on Props. It's also a convenient abstraction that allows us to swap out how actors are created internally - for instance, Akka.DependencyInjection uses the ActivatorUtilities inside MSFT.EXT.DI to instantiate actors so you can blend DI'd and non-DI'd arguments. That being said, we're probably going to be using a Func-based input for Props in the future in order to make Akka.NET more AOT-friendly in v1.6.
@StannardianАй бұрын
Thought I wrote a reply here but maybe I missed it - the big difference is that Props is serializable, so it can be used for remote deployments. It's also able to deal with other configuration issues like customizing the actor's mailbox (i.e. use a priority queue), dispatcher, using a router, and more.
@Petabridge4 ай бұрын
One thing I'll point out, in hindsight about some of the typed constraints - Value Objects can and will help a lot with improving type safety generally, so long as you don't allow them to be implicitly cast back and forth to their primitive implementations. We discussed this on a later video here: kzbin.info/www/bejne/farPf4mqerCSgpo
@noname785204 ай бұрын
too bad resolution for and interesting topic T.T
@Petabridge4 ай бұрын
Oh, the resolution of the source code size? yes sorry about that, we probably should ask for users to increase the font size significantly going forward
@KvapuJanjalia5 ай бұрын
Fixed a ".NET bug" - Do you mean a bug in .NET Runtime? Is this a clickbait title?
@Petabridge5 ай бұрын
It's a bug in a popular .NET distributed programming framework? How on earth would that title be clickbait?
@jackkendall64205 ай бұрын
What an odyssey! This is a tour de force kind of video alright
@Petabridge4 ай бұрын
Thanks!
@mitzrael2k65 ай бұрын
Nice video, Aaron! Just one thing that wasn't clear to me in the end: in case the split brains situation happened to my system, before the fix, what should I do to remedy it? Just restart the server?
@Petabridge5 ай бұрын
That's a great question - so you'd need at least a 3-node cluster in order to even run into this problem (something I probably should have mentioned in the video) and the issue would be that at least two of the surviving nodes would have duplicates. The most robust solution would be to SLOWLY restart both of them - waiting at least 20 seconds between each. That'd remedy the current situation and prevent it from happening again. Detecting the duplicate would be the hardest part, probably, unless you had good OpenTelemetry support that could prove that more than 1 instance of the same entity actor was alive concurrently.
@Petabridge5 ай бұрын
Just a heads up - we reference a bunch of other videos throughout this one; we've added the appropriate KZbin info cards but for the past year or so they've not worked properly. No idea why. So, every other video we reference: Akka.Cluster Simply Explained: kzbin.info/www/bejne/boHIn4Wles-NgcU Distributing State Reliably with Akka.Cluster.Sharding: kzbin.info/www/bejne/aJLTd6dvq5WJoNk Split Brains Explained: kzbin.info/www/bejne/l4XYaIqLf8t6pZo Consistent Hash Distributions Explained: kzbin.info/www/bejne/mKqvkHapZcl6hZI Introduction to Petabridge.Cmd: kzbin.info/www/bejne/mGi0qZpojs6Ciqs Introduction to Phobos 2.0: kzbin.info/www/bejne/nJaoqYx4mNZ0qsU Introduction to Akka.Hosting - HOCONless, "Pit of Success" Akka.NET Runtime and Configuration: kzbin.info/www/bejne/g5_FaopveNGheJI These, the original GitHub issues we fixed, and more are also linked in the description.
@AndreLoker5 ай бұрын
Thanks, Aaron
@Stannardian5 ай бұрын
I have no idea why all of our callouts to other videos stopping working on KZbin as of like, 6 months ago, but it's a real bummer
6 ай бұрын
Thanks for the video, it was very useful!
@Petabridge5 ай бұрын
Glad to hear that!
@weminuche076 ай бұрын
Much easier to spin up the actor system than before!. What I think is missing is more of a real-world example when people need to inject their own services/repos or other dependencies. The DbContext example is good and using a scope definition make sense. But I think there is some context missing in the exmaple. Where would UpdatePublishDefinitionAsync live? Where did you get the reference to _serviceProvider?
@Petabridge6 ай бұрын
Ah I got the reference to the `IServiceProvider _serviceProvider` by just making that one of my CTOR arguments on that actor
@Petabridge6 ай бұрын
An example of how to do this: github.com/petabridge/akkadotnet-code-samples/blob/master/src/cqrs/cqrs-sqlserver/CqrsSqlServer.Backend/Actors/ProductProjectorActor.cs edit: we wrote and published this sample AFTER the video was made
@JorikvdWerf6 ай бұрын
Very interesting video - loved the 10 lessons! Would be nice if there was an example implementation of some of them, such as the desired/current state implementation
@JorikvdWerf6 ай бұрын
How is the MariaDb support with Akka.Persistence.Sql?
@Stannardian6 ай бұрын
Unsure - never tried to use it myself
@JorikvdWerf7 ай бұрын
Awesome video, thank you :D One question, when would you use Context.System.Materializer vs Context.Materializer?
@Stannardian7 ай бұрын
Use Context.System.Materializer when you want to host the Akka.Streams actors as children of the current actor, Context.Materializer if you want them to be top-level actors underneath the ActorSystem. The difference with the former is that you have much more implicit control over the lifecycle of those Akka.Streams graphs - i.e. the graph will always terminate when the parent actor is terminated.
@ranggatohjaya7 ай бұрын
Very nice
@101_vikramshukla67 ай бұрын
Good video , Thanks Petabridge
@Petabridge7 ай бұрын
<3
@BrentMaxwellian7 ай бұрын
Super helpful, thanks! This video helped us redesign our state machine to increase actor concurrency and reduce queue depth. Appreciate your guidance!
@Petabridge7 ай бұрын
Glad you liked it!
@101_vikramshukla67 ай бұрын
very nice abstract of akka. It gives a very good overview. Thanks Aaron Stannard.
@AndreLoker7 ай бұрын
It would have been interesting to compare async/await to a more complex approach with PipeTo including behavior switching/stashing/unstashing (to mimic suspension of the mailbox during asynchronous processing).
@robadobdob7 ай бұрын
One caveat is central package management requires some specific tasks when using Azure DevOps CI pipelines. It’s buried at the bottom of the official MS docs page.
@Petabridge7 ай бұрын
ah, for doing restore or something else?
@robadobdob7 ай бұрын
@@Petabridge correct. You can’t use the “dotnet restore” task. Instead you have to NuGetAuthenticate and then do a restore from a Powershell task.
@Stannardian7 ай бұрын
@@robadobdob is this using the built-in AzDo task or just running the dotnet cli? We implicitly do restores but we just call the CLI commands directly for this
@emreerkan948 ай бұрын
Can you share the source code?
@Petabridge7 ай бұрын
Sure thing - just added a link to the description with it too. You can find the source here: github.com/petabridge/akkadotnet-code-samples/tree/master/src/cqrs/cqrs-sqlserver
@pkuioouurrsq-yb8ku8 ай бұрын
very bad tutorial. U started from a point giving no clue to the viewers about what u are trying to do
@Stannardian8 ай бұрын
“Implement Event Sourcing and CQRS Using Akka.Persistence” - seems pretty clear to me
@LeviRamsey8 ай бұрын
1100 bytes is in fact 8.8 kilobytes.
@Petabridge8 ай бұрын
I had a lot of trouble keeping track of the different measures that were getting used throughout the various projects, so in our benchmarks we use a range of size parameters from 10b all the way up to 8kb github.com/petabridge/TurboMqtt/blob/dev/docs/Performance.md
@Petabridge8 ай бұрын
Performance takes a noticeable dip between 2kb and 8kb and I suspect that's because we're significantly over the TCP max segment size (1140ish bytes IIRC), so each "packet" now requires more work to transmit at the syscall level
@JohannesHansen19808 ай бұрын
Be careful. If you instantiate those with the default keyword like 'default(NonZeroUInt16)' the int will be initialized to 0. It's also a problem if you make an array like 'new NonZeroUInt16[10]'. They will all be initialized to 0.
@Petabridge8 ай бұрын
In this case, we're going for "better than nothing" without compromising on performance by using a value type, which yes - is fully zero'd by by default(T). Perfect isn't achievable - developers can find a way to still abuse and break things. You'd need a Roslyn Analyzer to catch that, since there's no guarantee with structs that the CTOR will be called.
@FilipCordas3 ай бұрын
@@Petabridge wait couldn't you just default it to 1? Value = 1
@Stannardian3 ай бұрын
@@FilipCordasbet you’re right!
@FilipCordas3 ай бұрын
@@Stannardian no my bad constructors don't run on default init it just sets the field.
@thanhdev45698 ай бұрын
hi! I have a question: Am I must setup a MQTT Server or not ?
@Petabridge8 ай бұрын
You'll need to use an MQTT broker - before you can use TurboMQTT. EMQX is a simple, high performance one you can get started with
@brahmcdude6858 ай бұрын
vagif's audio is not the best :(
@InshuMussu8 ай бұрын
Could you please guide me on analyzing an application running in a production environment?
@Petabridge8 ай бұрын
I'll see what I can do - that might merit doing a separate video
@luc9volts8 ай бұрын
Nice !!! Much easier than the old way ! 👍👍
@AndersonPhiriPAC28 ай бұрын
Any chance for self-paced course from petabridge
@Petabridge8 ай бұрын
Yes, we're working on that!
@RichardHarding449 ай бұрын
These use case demos are super useful thanks
@tarasbuha77269 ай бұрын
Streams on clusters will be very nice to get more information
@Petabridge9 ай бұрын
Our recent video on Spectre.Console demonstrates how to use StreamRefs for this
@tarasbuha77269 ай бұрын
@@Petabridge thanks for the reply
@tarasbuha77269 ай бұрын
Fantastic talk! I’m thinking to implement something similar in my project.
@poclearn9 ай бұрын
Great Video... best explanation
@RomanLi-y9c9 ай бұрын
for large number of nodes 10k+ I'd try Mesos en.wikipedia.org/wiki/Apache_Mesos
@brahmcdude6859 ай бұрын
very nice. but this is just for normal systems. what about tests?
@brahmcdude6859 ай бұрын
answer: add something like this to your csproj: <PackageReference Include="Akka.Hosting" Version="1.5.19" /> <PackageReference Include="Akka.Hosting.TestKit" Version="1.5.19" /> write something like this code - using Akka.Hosting.TestKit; var dependencyResolver = DependencyResolver.For(Sys); var props = dependencyResolver.Props<MyLogActor>(); var myLogActor = ActorOf(props, nameof(MyLogActor)); myLogActor.Tell(new MyLogActor.Messages.Create(logFileName)); you can leave your override void ConfigureAkka method empty.
@brahmcdude6859 ай бұрын
i wish you could create an example. and code it from scratch. because i have no idea what is going on.
@Petabridge9 ай бұрын
I just used the sample actors from our dotnet new templates here: github.com/akkadotnet/akkadotnet-templates
@brahmcdude6859 ай бұрын
@@Petabridge great. going to take a look now.
@brahmcdude6859 ай бұрын
i am sooooo confused :(
@Petabridge9 ай бұрын
UPDATE: please watch "Everything You Wanted to Know about Dependency Injection and Akka.NET" kzbin.info/www/bejne/jn-sh4ZrnaeHi80 instead, which demonstrates how to use Akka.Hosting to do DI even more efficiently than the techniques we originally included in this video back in 2021.
@malcolmlearner10 ай бұрын
I'm not seeing the link to "Intro to Akka.Cluster" you mentioned at 1:40.
@Stannardian10 ай бұрын
Yes it's weird - I can see it on the cards I added to the video but it's not popping up. Wonder if there's an issue with the YT editor.
@Petabridge7 ай бұрын
Whoops, my bad kzbin.info/www/bejne/boHIn4Wles-NgcU&
@h3techsme10 ай бұрын
Absolutely fantastic! I love the use of the "inner loop" info to create a high level picture of what's going on behind the scenes.