These are chat archives for akkadotnet/akka.net

20th
Jun 2018
Aaron Stannard
@Aaronontheweb
Jun 20 2018 02:17
yeah that might do it
would be good to document it
Lutando Ngqakaza
@Lutando
Jun 20 2018 11:56
Whats the best way to bfs/dfs through the actorsystem just to get all the actor paths for view purposes?
(and is this possible if i had to throw clustered actor systems into the mix?)
trying to infer a way through ActorSelelection and wildcards but I cant see how I can do this using that
Aaron Stannard
@Aaronontheweb
Jun 20 2018 12:17
that's how I built the actor hierarchy command in Petabridge.Cmd
it's just a recursive traversal of the actor hierarchy using wildcards
with a limited amount of depth and time
Lutando Ngqakaza
@Lutando
Jun 20 2018 12:22
right ok, i will play around with it and see what i can come up with.
fleed
@fleed
Jun 20 2018 13:07
@Aaronontheweb I need actors for both onpremises systems and Azure ServiceFabric, so Akka.net seems the right solution.. is there documentation about scaling the actors on ServiceFabric?
Aaron Stannard
@Aaronontheweb
Jun 20 2018 13:32
@fleed sadly no - nothing official. Although I do believe we have a bunch of users who are currently doing it
cc @mmisztal1980 gave a presentation on it IIRC
service fabric tutorials have been on my to-do list for a long time - popularly requested item
the stuff I've been working on lately https://github.com/petabridge/akkadotnet-bootstrap
in terms of getting Akka.NET running in cloud environments
need to go back and finish the Docker bootstrap stuff now that we added port-aliases
next on my to-do list is K8s since Petabridge is going to be using it for some of our services
no reason why we couldn't do Service Fabric though
I'll be adding some tutorials to go along with those libraries though
walking through how to actually use the tech and plan deployments accordingly
fleed
@fleed
Jun 20 2018 13:44
thank you @Aaronontheweb
Aaron Stannard
@Aaronontheweb
Jun 20 2018 13:45
wish I could have been more helpful!
fleed
@fleed
Jun 20 2018 13:51
Was the any progress on the integration with the IServiceCollection and the new DI?
Aaron Stannard
@Aaronontheweb
Jun 20 2018 13:51
in terms of ASP.NET Core DI and Akka.NET
here's an example I put together
important, important detail of how this app works
I need to have a IHubContext from SignalR inside one of my actors
because the actor system writes out to a websocket when progress updates come in
so I have to start my ActorSystem last
so I start my ActorSystem inside this IHostedService
and DI can pass in that context I need for SignalR in here
but opted to just do it via message for reasons I can't recall right now
either way of doing it is valid
does that help?
fleed
@fleed
Jun 20 2018 13:56
that helps a lot, thank you
Aaron Stannard
@Aaronontheweb
Jun 20 2018 13:58
I should just write a blog post about that
now that I'm sitting here thinking about it
lol
nathvi
@nathvi
Jun 20 2018 14:09
do iiiit
do IT
Stijn Herreman
@stijnherreman
Jun 20 2018 14:23

so I start my ActorSystem inside this IHostedService

I'm also doing that :)

I was hoping to get permission from higher up to write a blog post in a couple months, explaining some stuff of our architecture
Stijn Herreman
@stijnherreman
Jun 20 2018 14:29
@fleed The difficult part of running Akka.NET on Service Fabric is learning how to work with Service Fabric :) Our current set-up is an executable with Akka.NET doing the majority of the work, and an ASP.NET Core application with Akka.NET inside a BackgroundService to communicate with it from the outside. The ASP.NET Core app is hosted in Kestrel to avoid application pool recycles. I do have to mention that Aaron will be reviewing our architecture soon, so take what I said with a grain of salt ;)
zbynek001
@zbynek001
Jun 20 2018 16:24
we're also running our clusters on service fabric, it's not that bad
Aaron Stannard
@Aaronontheweb
Jun 20 2018 18:35
I was hoping to get permission from higher up to write a blog post in a couple months, explaining some stuff of our architecture
:+1:
nathvi
@nathvi
Jun 20 2018 20:11
Why can't you use "new" to create actors?
Arjen Smits
@Danthar
Jun 20 2018 20:50
because actors live in an actorsystem
they cant exist without it
so thats why you tell an actorsystem to create an actor for you
Upside is, this abstraction allows for many of the akka abstractions
like creating an actor, but having it actually be a router, or live on a different node, etc etc
nathvi
@nathvi
Jun 20 2018 21:58
then why can't you just have each actor take in an actor system reference in the constructor?
nathvi
@nathvi
Jun 20 2018 22:04
It just seems like a very kludgy way of creating actors.
Aaron Stannard
@Aaronontheweb
Jun 20 2018 22:04
that Props formula is necessary for allowing the restarting of actors
nathvi
@nathvi
Jun 20 2018 22:04
Why?
Aaron Stannard
@Aaronontheweb
Jun 20 2018 22:04
tells the other parts of Akka.NET how to re-create an actor instance
which constructor to use
which arguments get passed in
etc
since part of the goal of restarting is to reboot the actor back into a well-known, "safe" state
the initial state the actor launched in, as determined by props, meets that requirement
on top of that, have to have some way of hooking your actor up to its infrastructure
which is the thing that uses props to start it
(ActorCell)
gives the actor a mailbox, a dispatcher to schedule onto
and other properties, such as the supervision strategy it uses to manage its children
nathvi
@nathvi
Jun 20 2018 22:11
So Props encapsulates how to create an actor in case of a failure. Couldn't you get that data automatically by having the actor system reflect over created instances of actors before adding them to the actor system?
Boban
@bobanco
Jun 20 2018 22:15
@nathvi also the actor you are talking to might live or it might be created on the fly in case of cluster sharding so u cant simply just use new