These are chat archives for akkadotnet/akka.net

20th
Sep 2016
Corneliu
@corneliutusnea
Sep 20 2016 00:42
I might stay up .. I generally only finish my work around midnight anyway .. might play some xbox and then join your session
just that I have another session for another project next nigth @ 1am again
Aaron Stannard
@Aaronontheweb
Sep 20 2016 01:20
lol
oh man
that's rough
Luis Belloch
@luisbelloch
Sep 20 2016 08:44
hello! I'm adding akka to an existing project and I was wondering how is progressing the changes planned for DI in #1675
does it worth to use the "old" way? or just leave DI aside and wait for the final implementation? thanks!
Arjen Smits
@Danthar
Sep 20 2016 09:15
@luisbelloch Any changes in the DI Api have been shelved until a later release. The DI api as it is now is usable, but not ideal.
If you can integrate Akka without using DI. I would recommend doing that. It would lead to a better design
Peter Hvidgaard
@hvidgaard
Sep 20 2016 10:35
Speaking of DI, is there a way to temporarily disable the check that cast an exception when trying to create an actor with new? SimpleInjector will try to create an instance of all registered types and their dependencies, to ensure that it can actually create everything.
Max
@maxpaj
Sep 20 2016 11:15
Maybe this is a more general question regarding NuGet packages... But has anyone else had issues with Visual Studio where methods / members in the framework seem to be inaccessible or unavailable in the IDE, but the project builds fine. I'm so confused with this - only had this issue with Akka so far, hence I'm asking here.
Max
@maxpaj
Sep 20 2016 11:29
I should add, I'm seeing this specifically with Akka.Persistence package
Arjen Smits
@Danthar
Sep 20 2016 11:40
@maxpaj i have that sometimes, its usually related to some cache files not being updated.
Max
@maxpaj
Sep 20 2016 11:41
Alright... I've tried removing the packages folder and restoring NuGets again. Not working. Any ideas where these cached files could be located?
Arjen Smits
@Danthar
Sep 20 2016 12:56
_resharper folder (if your using resharper). You .suo file can sometimes cause wierd stuff, so deleting that can help (it will be regenerated). Other then that doing a Solution Clean might help (it deletes your obj folders)
Max
@maxpaj
Sep 20 2016 13:41
I am using Resharper, not sure where that folder is though. Tried deleting the .suo file, didn't help :(
Weird thing is, things like Command<T> and Recover<T> are visible, but the Context property contains barely anything -- just a GetOrElse() method...
Scott Martin
@Scott__Martin_twitter
Sep 20 2016 16:20
@maxpaj I have had that happen to me. The easiest way I fix it is, go to: Tools -> Options -> Scroll to Resharper -> Suspend Now -> Resume Now.
Max
@maxpaj
Sep 20 2016 16:21
Yeah okay, it's Resharper for sure. Thanks Scott!
All methods / members appear when I shut it off
Scott Martin
@Scott__Martin_twitter
Sep 20 2016 16:22
Does anyone know how to turn logging down in the Akka TestKit?
Aaron Stannard
@Aaronontheweb
Sep 20 2016 16:55
@Scott__Martin_twitter you can pass HOCON, including logging settings, into the base constructor on the TestKit
the other thing you can do is mute certain events
Scott Martin
@Scott__Martin_twitter
Sep 20 2016 16:56
@Aaronontheweb That's what I was missing, I'll give that a try. I had tried to configure just like my non test system, but it never got picked up
Aaron Stannard
@Aaronontheweb
Sep 20 2016 16:56
Mute is a bit esoteric
but you can find examples of us using it inside our own tests
Scott Martin
@Scott__Martin_twitter
Sep 20 2016 16:57
Thanks!
Aaron Stannard
@Aaronontheweb
Sep 20 2016 16:57
that eliminates certain events from showing up in the log entirely
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:33
Can someone give me some guidance on creating ephemeral actors?
This is hard to explain... but, while processing a message, I want to create a child actor that needs to work on some stuff even after I finish processing said message.
And when the child actor is finished the system needs to react.
I'
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:35
so you want a fire-and-forget child actor?
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:36
Well, kind of but the child actors parent needs to react to the child finishing it's work.
I have a few confusions.
Should I store a reference to the child actor in the parent actor?
This is kind of unrelated, but how does the actor system go about cleaning up actors?
If I create a bunch of child actors, but never reference their IActorRefs I assume they are still alive and kicking processing anything they are sent. At what point are they killed off and memory freed?
Of course I realize that .NET is GC'd
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 17:39
@ronnieoverby they won't die by themselves, unless you explicitly say them to do so, or their parent will terminate, or the actor system will be shut down
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:40
Let me help myself by rephrasing the question. When creating actors, is there anything I should or shouldn't do so that I can avoid leaking memory?
@Horusiath It sounds like I need to be explicitly killing them off, which means don't throw away the IActorRef reference.
Is that right?
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 17:43

@ronnieoverby each actor will automatically terminate it's children if it will be terminated itself. Also you always can access children by using Context.Child(childName) or Context.GetChildren(). You can also target actors by using actor selection.

When it comes to strategy on how you can stop an actor, read this: https://petabridge.com/blog/how-to-stop-an-actor-akkadotnet/

Ronnie Overby
@ronnieoverby
Sep 20 2016 17:44
I'm good on how to stop actors.
Okay, I think that helps. My next question is... Is it an antipattern to maintain a collection of child actors, where the child actors lifes span multiple parent mailbox cycles?
I keep finding myself needing to do this, but feeling like I shouldn't have any state stored that spans multiple messages (making my parent actor more stateful)
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 17:47
no, it's fine - actor model is stateful by default
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:47
:joy:
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:47
yep, totally fine to do that
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:47
haha
Why the hell does it feel so wrong?!
I think it's because I'm used to trying to keep my web apps as stateless as possible
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:47
working against two decades of stateless web application development
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:47
haha yep
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:48
the default way we designed those types of systems
was treating the web application like "hot lava" and the database, usually SQL Server, as the "safe" zone
so most developers designed their software to rifle data into some sort of data store as early as possible
with the actor model, this is flipped on its head
the database is viewed as an inevitable bottleneck and source of problems
so we'd rather use it as infrequently as possible
treat it like backup storage for our state
whose primary residence is now in our application's memory
so it's only natural that it will take time to adjust to that
works counter to how we've been doing things
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:51
Well, I appreciate setting me straight
BTW, @Aaronontheweb did you look into that bug anymore, with the priority mailbox not generating priority?
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:51
I haven't yet
fixed up some clustering bugs and finally shipped Mono support
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:52
Okay. I did link to a github project that isolates and shows the problem.
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:52
that and some Akka.Cluster.Tools issues are next on my to-do list
I'll look at it some this week - may not get to it before this release
but if it's easy to reproduce and fix should be NBD
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:52
No sweat, I was only learning Akka when I discovered the bug... don't need it for any apps.
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:53
based on our last conversation I have a good idea what it might be
design issue with the way we set the priority generator on the queue
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:53
1 more: I heard you talking about some newly added CRDT support, but don't see anything in docs about it.
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:53
there's a PR open for it, a library called Akka.DData
@Horusiath is leading that
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 17:53
Akka.DistributedData ;)
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:53
I've been a POS and haven't reviewed it yet
see?
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 17:54
still needs some polishing
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:54
Oh on the podcast it sounded like it was finally out of some beta state.
What data type is it?
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:54
my bad :(
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:55
NP
Aaron Stannard
@Aaronontheweb
Sep 20 2016 17:55
AFAIK it's what, monotonic collections and that sort of thing?
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 17:55
CRDTs are usually variants of counters, sets and maps/dictionaries with different characteristics based on use case
Ronnie Overby
@ronnieoverby
Sep 20 2016 17:56
Yes, I'd be very surprised if you had implemented counters and sets and maps
I watched a video from Google going over all the various data types and there were maybe 7 or 8 concrete types he listed off
I've been following what Chris mccord has been doing with Phoenix presence, so I was interested about this CRDT support, too
This message was deleted
Ronnie Overby
@ronnieoverby
Sep 20 2016 18:01
Okay, I'm done flooding the room :)
This message was deleted
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 18:02
so far we have
Flags, GCounters, PNCounters, PNCounterMaps, ORSets, GSets, ORMaps, LWWRegisters, LWWMaps
Ronnie Overby
@ronnieoverby
Sep 20 2016 18:03
OOH that's exciting
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 18:03
they are already verified with specs and working - missing part is verification of correct replication across real cluster (it works locally)
also we need to make API more user friendly - this plugin has been ported from scala, which used a lot of implicit constructs and custom operators
Ronnie Overby
@ronnieoverby
Sep 20 2016 18:05
Are there any docs/blog posts around these types?
I'd love to play with them some
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 18:05
we'll port it too later
Ronnie Overby
@ronnieoverby
Sep 20 2016 18:06
Awesome....
Aaron Stannard
@Aaronontheweb
Sep 20 2016 20:09
Just enabled Mono builds to run against the dev branch
going to have them on for all PRs going forward
Justin Patterson
@StandBackBurrito
Sep 20 2016 20:44
Will stopping an actor kill all Tasks started with Task.Run
Bartosz Sypytkowski
@Horusiath
Sep 20 2016 20:45
@StandBackBurrito nope - actor doesn't know your code is running a tasks
Justin Patterson
@StandBackBurrito
Sep 20 2016 20:45
all I needed to know
thanks
Bart de Boer
@boekabart
Sep 20 2016 20:46
And in general, nothing can stop any task started with Task.Run, ever.
Ronnie Overby
@ronnieoverby
Sep 20 2016 20:46
apart from cooperative cancellation via CancellationToken
Justin Patterson
@StandBackBurrito
Sep 20 2016 20:46
thanks for the info