These are chat archives for akkadotnet/akka.net

15th
Jun 2016
Aaron Stannard
@Aaronontheweb
Jun 15 2016 00:01
checking out your router changes now
Tyagit3
@Tyagit3
Jun 15 2016 00:24
@Aaronontheweb how efficient is it for a server to hold clients' IActorRef in memory. Is there any workaround if clients' IActorRef is not to be saved in memory, as it'd be an overload if the number of clients is more.
Aaron Stannard
@Aaronontheweb
Jun 15 2016 00:25
RemoteActorRef
which is your remote handle to a client actor
is cheap
doesn't have any of the usual stuff an actor needs
like a mailbox
Tyagit3
@Tyagit3
Jun 15 2016 00:27
but still it would be in memory, right?
Aaron Stannard
@Aaronontheweb
Jun 15 2016 00:31
yeah, the RemoteActorRef would
and it would point to the client actor which would be sitting in memory on a different process or machine
Tyagit3
@Tyagit3
Jun 15 2016 00:35
Is there a way to store RemoteActorRef somewhere but not in memory.
Aaron Stannard
@Aaronontheweb
Jun 15 2016 00:36
no
Tyagit3
@Tyagit3
Jun 15 2016 00:37
Ok. Thanks
voltcode
@voltcode
Jun 15 2016 06:58
Hi guys, is the list of issues marked For Next Release on Waffle reflecting the actual state of 1.1 release ?
Arjen Smits
@Danthar
Jun 15 2016 07:35
@voltcode afaik its fairly up to date. I know @Aaronontheweb updated it a little while ago. So its either spot on, or missing a few things.
frasermolyneux
@frasermolyneux
Jun 15 2016 08:58
If you're using the internal scheduler is there a way of clearing previously scheduled stuff?
Bart de Boer
@boekabart
Jun 15 2016 09:11
per item by Cancelling their cancelable, obviously. Flushing it completely doesn't sound like a real use case...?
frasermolyneux
@frasermolyneux
Jun 15 2016 09:52
@boekabart Appreciated
hidavidpeng
@hidavidpeng
Jun 15 2016 11:29
hi How to use the ActorSelection for PoolRoundRobinGroup? I want to find a group rather than find a single actor.
Aaron Stannard
@Aaronontheweb
Jun 15 2016 17:04
@voltcode we're running behind on the 1.1 release, although not for a lack of trying
fixing some of the issues with clustering required us to also to make a lot more lower-level changes
to routers, mailboxes, and dispatchers
but there's some tremendous additional benefits to that
for instance, reducing actor memory footprint by about 34%
routers with configurable "controller" actors
which should make it feasible for you to build user-defined routers
Ivan R. Perez
@irperez
Jun 15 2016 17:06
@Aaronontheweb I'm looking forward to v1.1 ! Keep up the great work and am looking forward to seeing you at .net Fringe in Portland.
Aaron Stannard
@Aaronontheweb
Jun 15 2016 17:06
eliminated a lot of resource leaks on shutdown
stuff like that
@irperez thanks Ivan! glad to see you there!
@/all who else is going to .NET Fringe this year?
Peter Bergman
@peter-bannerflow
Jun 15 2016 17:09
@Aaronontheweb Keep up the good work man!
ilhadad
@ilhadad
Jun 15 2016 17:13
@Horusiath The config has not changed from when it was working. I think you guys updated things and the plugin we created for couchbase is blowing up. I have worked on it but we are not sure how to handle the new AtomicWrite message. One question we have is about the payload. It seems it is an object but it looks like it can hold several IPersistentRepresentation items. Not sure. We need guidance.
Bartosz Sypytkowski
@Horusiath
Jun 15 2016 17:15
@ilhadad IPersistentRepresentation.Payload always contains an event object, you've send through using Persist method
Chris Constantin
@cconstantin
Jun 15 2016 17:33
@Aaronontheweb I’m thinking about it. Maybe I can carpool with fellow Vancouverites and then take the train down from Seattle
Aaron Stannard
@Aaronontheweb
Jun 15 2016 17:34
all of the Akka.NET Canadians I know are in Montreal or Toronto :p
it should be a great conference - they have a great lineup this year
ilhadad
@ilhadad
Jun 15 2016 17:35
@Horusiath Yes I am aware of the IPersistentRepresentation.Payload having the event object. I am talking about the AtomicWrite.Payload. What's coming in it?
Aaron Stannard
@Aaronontheweb
Jun 15 2016 17:35
Don Syme, Hanselman, James Newton-King, probably will have Rich Lander and some of the Roslyn people again this year
Bartosz Sypytkowski
@Horusiath
Jun 15 2016 18:27
@ilhadad AtomicWrite.Payload is usually a collection of IPersistentRepresentations that are supposed to be written within single transaction. Most of the time it's a single element inside.
ilhadad
@ilhadad
Jun 15 2016 19:52
@qwoz Thanks for that. The config I had was working before. I know they updated the persistence layer. I think this is what's messing me up.
ilhadad
@ilhadad
Jun 15 2016 19:59
@Horusiath is there a reason why the AtomicWrite.Payload was left as an objec instead of IEnumerable<IPersistentRepresentation>? What do yo mean by usually? What would unusually would we see?
Bartosz Sypytkowski
@Horusiath
Jun 15 2016 20:18
@ilhadad good question, @cconstantin maybe you could add some comment on that?
Natan Vivo
@nvivo
Jun 15 2016 20:54
hey guys. quick question about akka cluster. I'm starting to look into it, just wanted to understand the general logic behind actor paths in clusters
ilhadad
@ilhadad
Jun 15 2016 20:54

@Horusiath @cconstantin Last question on this:

protected abstract Task<IImmutableList<Exception>> WriteMessagesAsync(IEnumerable<AtomicWrite> messages);

Returns a ImmutableList<Exception> - What do I return for the instances of the AtomicWrite that all went well (happy path). Null? Nothing? If nothing how does the code tie the error message to the AtomicWrite?

Natan Vivo
@nvivo
Jun 15 2016 20:54
Say I start an actor in a cluster into "/user/foo". is it correct that an actor selection to "/user/foo" is always local to the node?
Chris Constantin
@cconstantin
Jun 15 2016 21:01
@ilhadad happy path -> null
ilhadad
@ilhadad
Jun 15 2016 21:03
@cconstantin thanks for the reply. is there a reason why the AtomicWrite.Payload was left as an objec instead of IEnumerable<IPersistentRepresentation>? What do yo mean by usually? What would unusually would we see?
Chris Constantin
@cconstantin
Jun 15 2016 21:04
@ilhadad in a call, will get back to you once call is over
AW implements IPersistentRepr, and that’s where Payload is defined
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:15
@nvivo yessir
effectively each node in the cluster is still a "local" actor system
but you can use things like clustered routers
or DistributedPubSub
ilhadad
@ilhadad
Jun 15 2016 21:16
@cconstantin to be clear, the AtomicWrite.Payload should be casted to IEnumerable<IPersistentRepresentation>?
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:16
to message actors on other nodes that join and leave the cluster
Natan Vivo
@nvivo
Jun 15 2016 21:16
yeah, I'm trying to understand the general logic behind the paths. Now I think I got it, all remote actor refs reside into /remote right?
so /user will always be local
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:16
all of the remotely deployed actors will be parked under /remote, right
all of your /user actors are always logically local actors
the only exception to that
two actor systems, A B
A remotely deploys a top level actor to B
called "foo"
A will have a remote actorref at path /user/foo
Natan Vivo
@nvivo
Jun 15 2016 21:17
hmm
right
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:17
which actually points to an actor that lives at /user/remote/akka.tcp/SystemAAddress.../user/foo
on system B
a clustered pool router
will remotely deploy routees onto nodes that join
Natan Vivo
@nvivo
Jun 15 2016 21:18
so, in general any communication between nodes requires either a specific remote path, or better a cluster router
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:19
or replying back to a remoteactorref
i.e. another node in the cluster sent you a message
you replied back
to the Sender
but yeah, to initiate communication with another cluster node
you're correct
clustered routers are the easiest way to do this
Chris Constantin
@cconstantin
Jun 15 2016 21:20
@ilhadad correct
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:20
if you had some scenario where a clustered router wasn't the right tool for the job though
you can always grab the current state of the cluster using the Cluster actor system extension
ilhadad
@ilhadad
Jun 15 2016 21:21
@cconstantin thanks.
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:21
Cluster.Get(yourActorSystem).ReadView I think
that object will contain a list of all of the members, their addresses, their status (down / up), their reachability (reachable / unreachable), and any roles you may have defined for them
so you could use that data to create an ActorSelection if needed
Natan Vivo
@nvivo
Jun 15 2016 21:22
ok, cool
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:22
you can also use the Cluster actor system extension
to subscribe to gossip events
i.e. be notified when a member joins, leaves, etc
there's a Subscribe / Unsubscribe set of methods for that
Natan Vivo
@nvivo
Jun 15 2016 21:22
I'm reading the current docs right now
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:22
essentially this is what the clustered routers do for you internally
Natan Vivo
@nvivo
Jun 15 2016 21:23
There is a lot of details on the inner workings, but I'm missing the basics
:-D
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:23
I know we have work to do on improving the docs there
so apologies for the confusion in advance on my part
Natan Vivo
@nvivo
Jun 15 2016 21:23
no worries, I promised to help a ton of times and ended up doing nothing :-D
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:23
OSS is hard work my friend
no worries
Natan Vivo
@nvivo
Jun 15 2016 21:25
ok, so even though all nodes have the same actor system name, once I do "system.ActorOf<Foo>", I'm actually starting each Foo in each node and they don't know about each other unless I create a router or a singleton or handle manually the messaging
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:25
that's correct
Chris Constantin
@cconstantin
Jun 15 2016 21:25
@ilhadad let me know if you get blocked on something. Persistence was the first area I touched in akka, and I wouldn’t be surprised if I did something weird.
Natan Vivo
@nvivo
Jun 15 2016 21:26
and do routers require a specific machine to run? for example, say I have multiple "services" and I want to say "if you send message to /service, send to any of these"
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:26
that's what cluster roles are for
a role is basically just a string
that describes some capability of an individual node
i.e. in webcrawler we have tracker, web, crawler, and lighthouse roles
you can specify on your router "only target actors at this path on nodes of role X"
ilhadad
@ilhadad
Jun 15 2016 21:27
@cconstantin I am trying to figure out why would you choose to use object type for AtomicWrite.payload as opposed to IEnumerable<IPersistentRepresentation>?
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:28
it's in the use-role setting on the router.cluster hocon syntax
the router runs locally on the machine it's declared on
but builds its routing table based on the data it gets from the Clustering daemon
which is just a system actor that collects gossip data from other nodes and updates the cluster's state
and broadcasts gossip back
Natan Vivo
@nvivo
Jun 15 2016 21:29
so, the cluster router is actually a local routing table?
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:29
correct
Natan Vivo
@nvivo
Jun 15 2016 21:29
hmmm
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:29
but all of the actors it routes to are remote
Chris Constantin
@cconstantin
Jun 15 2016 21:29
@ilhadad as I said, that field is defined IPersistentRepr because is needed in NonPersistentMessage as well
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:30
let me grab a HOCON sample rq
Natan Vivo
@nvivo
Jun 15 2016 21:30
so, if I have 10 nodes, I start the cluster router in each of them just to know where the routees are?
that's where I got it wrong. i was thinking about the router as a singleton in the cluster
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:30
that's correct
Natan Vivo
@nvivo
Jun 15 2016 21:31
it's actually just a "local service"
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:31
yep - it's just a peer in a network
Natan Vivo
@nvivo
Jun 15 2016 21:31
makes sense
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:31
and a router is just a way of being able to talk to specific actors on other peers
akka {
                        actor {
                            provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
                            deployment {
                                /api/broadcaster {
                                    router = broadcast-group
                                    routees.paths = ["/user/api"]
                                    cluster {
                                            enabled = on
                                            max-nr-of-instances-per-node = 1
                                            allow-local-routees = on
                                            use-role = tracker
                                    }
                                }
apologies for the weird formatting
copied and pasted this from an App.config file
in the cluster section here
allow-local-routees = on means that this group router could also route to any local actors that exist at "/user/api"
Natan Vivo
@nvivo
Jun 15 2016 21:33
so this router will contain all "/user/api" actors in any nodes with the "tracker role"
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:33
as long as the node running this code also has a role of type tracker
that's correct
Natan Vivo
@nvivo
Jun 15 2016 21:33
and if I don't start that actor?
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:33
it's just like any other group router
it creates an ActorSelection
and if that selection can't be delivered
it goes to deadletters
Natan Vivo
@nvivo
Jun 15 2016 21:34
right
ok. I think I got the basics
=)
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:34
max-nr-of-instances-per-node = 1 does nothing for group routers
that setting is for pool routers only
this router was originally a pool router
forgot to delete that when I changed it
Natan Vivo
@nvivo
Jun 15 2016 21:35
cool. but I got the idea, time to do some testing then =)
Thanks a lot
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:35
:+1: happy to help
Natan Vivo
@nvivo
Jun 15 2016 21:35
hey, i completely forgot the date you were coming to brazil!
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:35
that was during Easter
Natan Vivo
@nvivo
Jun 15 2016 21:35
I put in my calendar, but didn't add a reminder.. duh
Aaron Stannard
@Aaronontheweb
Jun 15 2016 21:35
I was pretty sick during that trip\
didn't stop me from having fun though
I should have reached out
my bad man
Natan Vivo
@nvivo
Jun 15 2016 21:36
np
thanks for the instructions.
ilhadad
@ilhadad
Jun 15 2016 21:39
@Aaronontheweb On hangouts