These are chat archives for akkadotnet/akka.net

14th
Aug 2015
Aaron Stannard
@Aaronontheweb
Aug 14 2015 00:08
thanks @haighis
working on syncing all of my repos to Travis now
I figure it'd be fun to switch things up a bit a give Travis a try on this repo
John Haigh
@haighis
Aug 14 2015 02:11
@Aaronontheweb make sure you specify the solution name correctly.. I didn't ...can you merge this PR akkadotnet/HOCON#25
Suhas Chatekar
@schatekar
Aug 14 2015 06:23
@Aaronontheweb I added some questions on the PR for the multinode spec you ported. This is more for my understanding of how the spec works
I am not sure if it was appropriate to add comments on the PR though
Tomas Vana
@creepone
Aug 14 2015 06:45
blob
@Aaronontheweb I boiled it down to this gist. I start 2 instances of this app, reconfiguring each to point to the other one. If I kill one of them and wait for ca. 2 seconds, the first one does get the Terminated message and Peer terminated is printed. However, if I'm too fast to restart the killed instance running on the same port, the first one gets confused, spits out the errors above and the Terminated message is not received.
Roger Johansson
@rogeralsing
Aug 14 2015 07:32
@creepone that sounds like an UID issue, the new system should not get the same UID as the previous one and the cluster should not think they are the same
Tomas Vana
@creepone
Aug 14 2015 07:33
@Aaronontheweb I just figured that adding AwaitTermination after the Shutdown call fixes it both in 1.0.4 and 1.0.5 if I stop it gracefully. When killing it hard, even in 1.0.5 the behavior is same though. Of course when under my control I can try to gracefully close it down, but what if it crashes on me and gets restarted automatically ?
@rogeralsing That sounds plausible. Is there any way to confirm (find out what the UIDs are) ?
Roger Johansson
@rogeralsing
Aug 14 2015 07:36
what bits are you running? nuget or dev branch?
Tomas Vana
@creepone
Aug 14 2015 07:38
I tried both nuget and 1.0.5.69-beta from the MyGet feed.
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 07:40
@Aaronontheweb why did you put all of the spec porting tasks in a separate issues each? This feels a little messy for me
also guys, what is the state of the Paket in akka.net?
Roger Johansson
@rogeralsing
Aug 14 2015 07:48
@Horusiath I think the individual issues are good, easier for new contrbutors to pick just one and complete that one
also, IMO we should have a meeting regarding Paket and Migrant, not stuff we can decide too lightly
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 07:52
@rogeralsing I have a hard time in my work right now, I couldn't manage enough time to test Migrant myself, my concern is still performance comparison
billyxing
@billyxing
Aug 14 2015 08:32
@Aaronontheweb here is the gist where I am setting it up and handling terminated message. gist
Steven van der Merwe
@SaberZA
Aug 14 2015 08:52
Hey all, I'm trying to assess the use of Akka.Net in production. Currently, I'm looking at some sort of DDD approach with async / non-blocking IO operations for all my logic components, and I just feel that Actors is the space that I need to be in right now. I am also likely to have scaling problems, so the actor model seems even more viable. Is the current Akka.Net version stable enough for production?
Roger Johansson
@rogeralsing
Aug 14 2015 09:00
@Horusiath Ill do some benchmark tests. My guess is that network will be a larger overhead than serialization
They do use reflection emit heavily so i think they have perf under control. But Ill check it out
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 09:11
@SaberZA we already have a guys running it on production
Geert Van Laethem
@GeertVL
Aug 14 2015 09:31
What is the best time of the day to ask for new issues to work on?
Key contributors are not online whole day I suppose.
Roger Johansson
@rogeralsing
Aug 14 2015 09:50
I think we are, some in the US and some on Europe.
Geert Van Laethem
@GeertVL
Aug 14 2015 09:55
@rogeralsing can you give me a new issue or thing I can work on to help?
Roger Johansson
@rogeralsing
Aug 14 2015 09:58
Im out right now, check any "up for grabs" or "help wanted" issue and just add a comment to the one you want
Geert Van Laethem
@GeertVL
Aug 14 2015 10:02
@rogeralsing ok I will do that.
Maciek Misztal
@mmisztal1980
Aug 14 2015 10:20
Hey guys, I'm writing a simple tool to stress-test one of our apps, I'd apreciate a hint on how to measure the execution time of the HttpClient and attach it via PipeTo? (currently I'm piping the HttpResponseMessage :worried:
using (var client = new HttpClient())
            {
                var request = new HttpRequestMessage(msg.HttpMethod, msg.Uri);

                client
                    .SendAsync(request)
                    .PipeTo(Self);
            }
Coinio
@Coinio
Aug 14 2015 10:26
Hey guys. Love Akka.net so far and working through the bootcamp... Are any of you aware of any decent code demos / articles on Akka for games? I can only find very simple examples, which don't really address the issues I'm thinking about, mainly sharing /maintaining a single state of the world between each of the players/AIs. Each AI will need to know the state of the world in order to make decisions, and I can't think of how this would work without having some central MapActor that each AIActor has to ask/tell everything, which would seem like the MapActor ends up being a bottleneck. Is this one of the cases were Akka isn't necessarily a good fit?
Anthony Brown
@bruinbrown
Aug 14 2015 10:29
@Coinio I've not got anything written up but last September time I tried using Akka.Net on client game development. Is that what you're thinking of or more for backend stuff?
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 10:33

@mmisztal1980 you can create a custom response wrapper in SendAsync continuation like:

using (var client = new HttpClient())
{
         var request = new HttpRequestMessage(msg.HttpMethod, msg.Uri);

         var start = DateTime.UtcNow;
         client
               .SendAsync(request)
               .ContinueWith(task => !(task.IsCancelled || task.IsFaulted) ? new SuccessfulResponse(task.Result, start: start, stop: DateTime.UtcNow) : new FailedResponse(task.Result, start: start, stop: DateTime.UtcNow) , 
                      TaskContinuationOptions.AttachedToParent|TaskContinuationOptions.ExecuteSynchronously)
               .PipeTo(Self);
}

Task continuation options are used here to not spawn separate tasks for one simple operation (creating message wrapper), we attach it to task running SendAsync instead.

Coinio
@Coinio
Aug 14 2015 10:37
Just a simple single player monogame project for now, to test out/learn Akka.Net
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 10:40
@Coinio there are some examples on akka (jvm version) used for game dev - you can use those examples, API for both versions (JVM and .NET) is very similar. Have you tried that?
also depending on how big the state of the world will be and it's ability to be partitioned (maybe actor don't need the whole state, only slice of it), the different strategies may apply
Coinio
@Coinio
Aug 14 2015 10:50
@Horusiath I've come across a couple but I can't seem find any real code examples that are more than simple test games. I'll keep searching and finish the bootcamp first before I start getting ahead of myself :)
Maciek Misztal
@mmisztal1980
Aug 14 2015 11:08
cheers!
Damian Reeves
@DamianReeves
Aug 14 2015 11:36
Concerning PipeTo: If my intent is to allow my Actor to continue processing other messages while a long running task runs, then I don't need to use PipeTo correct?
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 11:40
@DamianReeves
  1. Don't introduce concurrency on an actor level. You'll introduce all problems of concurrency actors are supposed to solve. If you have long running tasks, isolate them in dedicated actors.
  2. PipeTo is used by and actor to keep up with task completion acknowledgements. You can use it without problems.
Damian Reeves
@DamianReeves
Aug 14 2015 11:43
@Horusiath thanks. Point 1. has been my preferred approach, but I wasn't sure if something else was preferred.
So if I need to write a file from records in a database I do:
  1. Create an Actor for the whole process, lets call it DataWriterActor
  2. Create a child of DataWriterActor called DataExtractor
  3. Do data access in DataExtractor
  4. Tell parent of results
    Is this the recommended approach?
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 11:45
except making them a parent/child relation, yes :)
Damian Reeves
@DamianReeves
Aug 14 2015 11:45
You keep them totally independent?
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 11:46
both of those actor types are making potentially risky operations, you could supervise them with dedicated parent actors and simply keep an actor ref between them
Damian Reeves
@DamianReeves
Aug 14 2015 11:48
Ok got it
Roger Johansson
@rogeralsing
Aug 14 2015 14:09
@skotzko what is the new "ready" label about ? it shows up on tasks that are not yet started so that seems odd
Weston
@ronnyek
Aug 14 2015 14:23
so with the io shit, can the actors be multiplexed against same port on same ip?
or is it like the actors host the tcp endpoint?
Sean Killeen
@SeanKilleen
Aug 14 2015 14:48
@rogeralsing maybe "ready" in the sense that tasks are ready to be worked on (e.g. acknowledged / explained enough)? Just spitballing a guess.
Roger Johansson
@rogeralsing
Aug 14 2015 14:49
ah, that could be it
Sean Gilliam
@sean-gilliam
Aug 14 2015 14:58
@Coinio you could be the first to write such an example ;)
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:01
@Horusiath put them into separate tasks because I'm asking some of our newer contributors to take them on - this makes it easier to assign them
@GeertVL all of these issues are available for work - we'd really appreciate your help with them: https://github.com/akkadotnet/akka.net/labels/akka-remote
Coinio
@Coinio
Aug 14 2015 15:03
@sean-gilliam Once I'm done with the bootcamp I'll definitely give it a go
Geert Van Laethem
@GeertVL
Aug 14 2015 15:12
@Aaronontheweb can you tell me why you closed #1136 without merging. I want to learn from the mistake I made.
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:12
@creepone we need to port the following spec to verify that the UID changes: akkadotnet/akka.net#1254, and this one for remote deathwatch akkadotnet/akka.net#1251
but even in the event of an unplanned termination, you should still get the deathwatch notification
@GeertVL yeah, I couldn't merge it into dev due to a merge conflict - asked you to do a rebase on dev a couple of weeks ago and never heard back
which would have resolved the issue
Geert Van Laethem
@GeertVL
Aug 14 2015 15:13
@Aaronontheweb sorry I was on vacation.
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:13
I figured you were busy
no worries man
you didn't do anything "wrong"
but I ended up needing that PR for something I had to work on
so I incorporated that change into one of mine
Geert Van Laethem
@GeertVL
Aug 14 2015 15:14
@Aaronontheweb do I still try to fix it or is it done now?
Ha ok. That answers my question
Ok I look at the issues on akka-remote.
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:15
thanks man, we'd really appreciate that
if you have any questions about what to do with those issues, you can always ping me in here or if you'd like I can give you my Skype info
Geert Van Laethem
@GeertVL
Aug 14 2015 15:15
On a side note, Is it wise to study scala and Akka to be more of a help with akka.net?
Yes please that makes it easier.
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:15
through the act of trying to port Akka to .NET, you'll end up learning a lot of Scala that way
Geert Van Laethem
@GeertVL
Aug 14 2015 15:16
I thought so.
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:16
for instance, they have their own version of the TPL (Scala Futures)
Geert Van Laethem
@GeertVL
Aug 14 2015 15:16
ok
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:16
which actually acts and behaves a lot like ours, but the names for things are a little different
Geert Van Laethem
@GeertVL
Aug 14 2015 15:16
I see.
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:17
the thing that, to this day, still trips me up though is that Scala has something like 200+ binary and ternary operators
for doing things like immutable list appends / removes
all sorts of stuff - makes the Scala code really concise but sometimes I find myself scratching my head
you'll pick it up faster than you might think though!
Geert Van Laethem
@GeertVL
Aug 14 2015 15:18
Ok but reading the book "Scala for the impatient" that I bought should be helpful :-)
And my skypehandle is geertvanl
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:19
cool, I'll add you
Geert Van Laethem
@GeertVL
Aug 14 2015 15:19
Tx Aaron
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:19
mine is the same as my Gitter handle
Geert Van Laethem
@GeertVL
Aug 14 2015 15:19
easy :-)
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:19
@haighis is there anything else I need to do for Travis-CI support?
Geert Van Laethem
@GeertVL
Aug 14 2015 15:19
Ok I jump into the code. Tx mate
Aaron Stannard
@Aaronontheweb
Aug 14 2015 15:19
you're welcome
Kamil Wojciechowski
@aph5nt
Aug 14 2015 16:27
Hi, i have got one question. Is it possible to distinguish when a persisten view is restoring its state and then its receiving new events ?
in my case, the persistance view is responsible for sending messages to a signalR actor
i dont want to spam UI with signalR messages while view will be rebuilding its state
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 16:29
@aph5nt I guess you're not talking about standard C# API?
Kamil Wojciechowski
@aph5nt
Aug 14 2015 16:30
right, forgot to mention
F# api :D
but atm it does not make any difference for me, it can be about C# api
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 16:34
hmm, actually it's not possible for persistent views. What you call receiving new events and restoring the state is undistinguishable in their case. You could use their properties however.
Kamil Wojciechowski
@aph5nt
Aug 14 2015 16:49
yhm, oki
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 16:50
sorry my mistake
there is no such property
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 16:58
in C# you have a property IsPersistent which can be used to identify if message has come from journal or not, but in general there is no such concept like receiving new events in views, because they are always recovering from journal (even on updates)
Anthony Brown
@bruinbrown
Aug 14 2015 17:21
Is it possible to run the tests for just one project?
Aaron Stannard
@Aaronontheweb
Aug 14 2015 17:52
@bruinbrown on the commandline?
or in visual studio?
and are these the multi-node tests or the full-blown ones?
err, the "normal" ones rather
Anthony Brown
@bruinbrown
Aug 14 2015 17:53
Either, xunit needing a VS package for a test runner seems a bit wat, I was wondering if there was anything in the build script to run it
Aaron Stannard
@Aaronontheweb
Aug 14 2015 17:54
@bruinbrown not offhand - but I'd accept a PR for the FAKE script to make that easier
need to help out our friends on Mono, right? ;)
@rogeralsing btw, got some love from Vaugh Vernon today: https://twitter.com/VaughnVernon/status/632235346588143617
Roger Johansson
@rogeralsing
Aug 14 2015 17:55
oh, nice!
Aaron Stannard
@Aaronontheweb
Aug 14 2015 17:55
I want to read his book
Andrew Skotzko
@skotzko
Aug 14 2015 17:56
that is awesome
@rogeralsing saw your msg from earlier. currently, ready label is the issues assigned for the next release (corresponds to that column in waffle)
Roger Johansson
@rogeralsing
Aug 14 2015 18:14
ah ok
Roger Johansson
@rogeralsing
Aug 14 2015 18:33
@Horusiath I've made some fixes to Migrant, now its "just" 5 times slower than Json.NET.. but its a lott better than those 24 times difference that it was at first
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 18:36
if you can make it 5x faster in hour of work, I feel a little afraid what you end up with on Monday :p
I've almost finished with the event adapters for akka.persistence, but I'm missing some of the HOCON methods, that are present in the JVM version
Roger Johansson
@rogeralsing
Aug 14 2015 19:04
Ok, any specifics ? Ill try to add them
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 19:07
can we somehow achieve behavior similar to this? ConfigObject.unwrapped
actual line of Scala code I need to translate is config.getConfig(path).root.unwrapped
ok, sorry I see it in our impl :P
Roger Johansson
@rogeralsing
Aug 14 2015 19:09
var unwrapped = ConfigurationFactory.ParseString(hocon).Root.GetObject().Unwrapped;
its a bit hidden :)
and do note, that the values, that is, strings and arrays and such, are still HoconValues that you have to do .GetString or GetInt on.. Im not sure if that is the case in the scala version
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 19:11
test suite will show ;>
Roger Johansson
@rogeralsing
Aug 14 2015 19:15
The way that Akka handles serialization is really stupid, first of all, it always requires a byte array result, even if the backing serializer can write directly to a stream. and secondly, we always serialize individual messages, there is no way to do batch serialization.
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 19:19
there are many lessons to be learned
Roger Johansson
@rogeralsing
Aug 14 2015 19:22
turns out that when using batch serialization, migrant is 4 times faster than json.net, but we cannot leverage that due to how jvm Akka handles serialzation
Bartosz Sypytkowski
@Horusiath
Aug 14 2015 19:23
hmm, but this could be potentially used in one case in persistence (and maybe in remote)
Arjen Smits
@Danthar
Aug 14 2015 19:44
@rogeralsing wouldn't sending multiple messages in one batch, cause a conceptual disconnect higher up the stack? Cause instead of sending 1 messages your sending multiple messages. So wouldn't that also force you to change the way how message delivery guarantee's are handled ? (not conceptually perhaps, but technically)
Aaron Stannard
@Aaronontheweb
Aug 14 2015 21:11
@Danthar is correct - it may be less performant to do things 1 at time at the framework level, but it makes it easier to have guarantees all the way down the stack