These are chat archives for petabridge/akka-bootcamp

6th
Jun 2018
Bob
@crowcoder
Jun 06 2018 11:02 UTC
@Aaronontheweb I intend for the actor system to be long running in a windows service. I thought I'd have a top level actor that creates children in its Receive() but they would just pile up , correct? Or should I just create the children once? Sorry for being dense.
Aaron Stannard
@Aaronontheweb
Jun 06 2018 14:31 UTC
not dense at all man
the actor model is a new animal for 99.9999% developers
what I'd do in your case, since having actors pile up indefinitely is a no-no
is have the children self-terminate after a period of inactivity
you can do this via the SetReceiveTimeout(TimeSpan) method inside your actors
that triggers a sliding window timer that resets each time an actor receives a message
if time expires, the actor will be sent a ReceiveTimeout message
which you can handle
and you can program your actor to Context.Stop(Self), which will allow it to self terminate
and if the actor needs to do any kind of clean-up first
nathvi
@nathvi
Jun 06 2018 14:33 UTC
^ Good to know!
Aaron Stannard
@Aaronontheweb
Jun 06 2018 14:33 UTC
you can do that by overriding the PostStop method on your actor
that's a bit of code that runs once the actor starts termination and it's no longer going to process any messages
so if you're using stuff like database connections or whatever
that's a good place to dispose them
does that make sense?
nathvi
@nathvi
Jun 06 2018 14:35 UTC
Does the actor system include a polymorphic synergy?
Aaron Stannard
@Aaronontheweb
Jun 06 2018 14:35 UTC
what do you mean?
nathvi
@nathvi
Jun 06 2018 14:36 UTC
Polymorphic synergy is the synthesis of a design principle. (Aka akka design + efficient message)
I'm just having fun. Making fun of business people
Aaron Stannard
@Aaronontheweb
Jun 06 2018 14:36 UTC
ah thank god
nathvi
@nathvi
Jun 06 2018 14:36 UTC
XD
Aaron Stannard
@Aaronontheweb
Jun 06 2018 14:37 UTC
for a second there I was wondering "is that a JavaScript thing?"
nathvi
@nathvi
Jun 06 2018 14:37 UTC
LOOOOOL
Sometimes the buzzwords are just too much
Aaron Stannard
@Aaronontheweb
Jun 06 2018 14:39 UTC
having a shared technical lexicon is useful insofar as it enables people from different languages and cultures to talk about the same thing relatively clearly
but yeah, you can veer from that into a cesspit of marketeering jargon pretty quickly
i.e "isomorphic web app" == programming Node.JS in a manner that pleases Hacker News readers
nathvi
@nathvi
Jun 06 2018 14:52 UTC
lol
Bob
@crowcoder
Jun 06 2018 15:22 UTC
@Aaronontheweb That makes sense now. Thanks so much for your time.
Aaron Stannard
@Aaronontheweb
Jun 06 2018 15:59 UTC
@crowcoder any time - feel free to ask questions in the main Akka.NET gitter chat too
people in there are friendly and happy to help