These are chat archives for akkadotnet/akka.net

4th
Apr 2018
Hyungho Ko
@hhko
Apr 04 2018 00:37
@Aaronontheweb Thank you. I will test it again.
Bart de Boer
@boekabart
Apr 04 2018 06:05
@MClode haven't used it myself but there is such a thing as Akka.Monitoring out there, I think it's just for that. https://github.com/petabridge/akka-monitoring
Lutando Ngqakaza
@Lutando
Apr 04 2018 08:19
Quick question; Is passing around IActorRefs as part of commands/messages ok, even in ClusterSharded cases?
nathvi
@nathvi
Apr 04 2018 14:05
Question, where can I find information about the next major release?
Also, who is in charge of this project?
@Aaronontheweb , ?
nathvi
@nathvi
Apr 04 2018 14:49
Another question. In the documentation it says that it is good practice to make a companion class for each actor to show what types of messages it can process. So then, if I have two different companion classes for actors A and B, and they can both process type X, how do I set up the inheritance to handle this?
I'm assuming I'd have to make a base class to inhereit from
nathvi
@nathvi
Apr 04 2018 15:10
Here's another situation I'm considering. ActorX can handle messages x,y,z and Actory Y can handle messages x,y. Because you can't inherit from multiple classes, the only way to compose is by using interfaces. Corect?
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:13
@nathvi I need to publish our roadmap for v1.4.0 still
just use a ReceiveActor
no need for inheritance of any kind there
nathvi
@nathvi
Apr 04 2018 15:15
So how do I share definitions of messages between companion classes for actors?
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:16
shared message definitions should go into a shared assembly
i.e. internal middleware
nathvi
@nathvi
Apr 04 2018 15:18
Ok, so if I have two classes ActorXMessages and ActorYMessages, and ActorXMessages contains MessageX class and ActorYMessages also needs to have access to MessageX, how do I set this up?
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:22
I'm going to need a diagram or a code sample to follow your train of thought here
but ReceiveActors can receive messages by their interface
nathvi
@nathvi
Apr 04 2018 15:22
Ok.
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:22
Receive<IDisposable>(d => d.Dispose());
for instance
nathvi
@nathvi
Apr 04 2018 15:26
I guess I'm confused here. When reading the text Another good practice is to declare what messages an Actor can receive in the companion object of the Actor, which makes easier to know what it can receive:
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:26
imho
maybe don't read the text too literally there
and just read the source code from the examples
that sounds to me like something that was translated from the scala project originally
but a practice that we do engage in
is nested / inner message classes
which is the CLR equivalent of what that text is describing
only makes sense to do that though if the message is handled by a single actor type
nathvi
@nathvi
Apr 04 2018 15:28
DemoMessagesActor , is that the "companion object" ?
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:28
strike "companion object" from the vocabulary
you're hanging up on that
nathvi
@nathvi
Apr 04 2018 15:29
What is a companion object?
that'd be a good example of one\
that we use in the internal design of our clustering system
but imho
seriously don't get hung up on it
where / how you define messages has zero technical impact on Akka.NET other than when you need to share message types over the wire
it's 100% about what makes your code easier to read and understand
and that is firmly a "your mileage may vary" subject
in my own apps I'm pretty good about defining shared vs. local messages
shared messages have to, by definition, be highly generalized
local messages NEVER travel over the network
only exist in-process
and are highly contextual
nathvi
@nathvi
Apr 04 2018 15:31
I see.
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:31
breaking up your messaging that way is a good practice
generally speaking, if you find yourself constantly changing your shared messages
i.e. changing their content or types
then your domain is probably designed wrong
service-to-service concerns are things I express in the shared messages
implementation details for how one specific service does its job are local messages
nathvi
@nathvi
Apr 04 2018 15:35
so when you say "only makes sense to do that though if the message is handled by a single actor type" you mean that following this practice only makes sense for local messages, correct?
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:35
correct
nathvi
@nathvi
Apr 04 2018 15:36
:)
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:36
so, good example of that
if I have an actor inside one instance of a service that flushes service-specific data to a database
I might have some commands specific to that exact actor type which describe how to do that
and I might define those commands as nested classes of the actor itself
no big deal - helps make the code a little more readable imho
nathvi
@nathvi
Apr 04 2018 15:36
oic
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:37
but I'm not going to try to remotely send that message over the network
because that'd break encapsulation and all sorts of other bad things
nathvi
@nathvi
Apr 04 2018 15:38
It may be just me, but I feel like having that further elaboration on how this is used with local messages and what that means would make the documentation more clear.
Good candidate for pr?
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:38
yeah
that's a good idea
nathvi
@nathvi
Apr 04 2018 15:38
:)
I'll do that.
@Aaronontheweb , do you work for Petabridge?
Aaron Stannard
@Aaronontheweb
Apr 04 2018 15:40
yep
nathvi
@nathvi
Apr 04 2018 15:40
cool
How's this for an edit?
"
Another good practice is to declare local messages (messages that are sent in process) within the Actor, which makes it easier to know what messages are generally being sent over the wire vs in process.
"
nathvi
@nathvi
Apr 04 2018 16:05
Just made a pull request for it akkadotnet/akka.net#3380.
nathvi
@nathvi
Apr 04 2018 16:30
I think it would be cool to make an interactive game showing how all the parts relate.
Maybe I'll do that as a side project.
nathvi
@nathvi
Apr 04 2018 16:40
I'm confused about this in the documentation...
"Akka persistence also provides point-to-point communication with at-least-once message delivery semantics." Why would persistence be mixed in with networking?
Ismael Hamed
@ismaelhamed
Apr 04 2018 18:31
For a QoS of type At-Least-Once you'd probably want to use some sort of durable storage
nathvi
@nathvi
Apr 04 2018 18:46
Is it possible to have windows service A on machine 1 build an actor A1 in windows service B on machine 2, and if service B is restarted, actor A1 will be persisted?