These are chat archives for akkadotnet/akka.net

6th
Aug 2015
jberzy
@jberzy
Aug 06 2015 00:00
@rdavisau I heard they're going to have the switching built into vnext so it won't be considered a hack anymore
not really sure how that works though.
Ryan Davis
@rdavisau
Aug 06 2015 01:24
@jberzy sounds promising, will look into it
Aaron Stannard
@Aaronontheweb
Aug 06 2015 01:53
@jfloodnet btw, got my azure sample working last night
turns out it was a really stupid bug on my part
had it working all along - was never a firewall issue
I forgot to change the actual listening address for my sockets from 127.0.0.1 to 0.0.0.0 :(
so I'll be publishing the azure sample soon around with some DevOps guidance for cloud services
Joe Flood
@jfloodnet
Aug 06 2015 01:55
@Aaronontheweb ah that's fantastic mate. I'll be looking at getting it going soon. so very good timing for me :)
cheers
Aaron Stannard
@Aaronontheweb
Aug 06 2015 01:59
thanks man - glad to hear it
yeah it's way easier to get cloud service clustering working than I thought
turns out it was me all along :p
next project I'll probably take on will be either Azure Service Fabric or on-premise
Joe Flood
@jfloodnet
Aug 06 2015 02:01
:) it's always the simplest things that take the longest to find
Aaron Stannard
@Aaronontheweb
Aug 06 2015 02:01
@/all quick question for Akka.NET users - which runtime / hosting environments do you care about? Going to do a post on building auto-clustering Azure cloud services. Want to know which platform I should do for the next one? On-premise? Service Fabric? AWS? Docker?
send me a private message or send me an @ message here in this chat
Joe Flood
@jfloodnet
Aug 06 2015 02:02
id be interested in docker as well..
Ryan Davis
@rdavisau
Aug 06 2015 02:03
@Aaronontheweb by runtime do you mean e.g. mono? i'd like to see something on linux :eyes:
Cecil Phillip
@cecilphillip
Aug 06 2015 02:03
@Aaronontheweb On-premise and docker would be interesting
Aaron Stannard
@Aaronontheweb
Aug 06 2015 02:03
@rdavisau heh, we need to get @rogeralsing to do a big blog post on his Raspberry Pi Akka.Remote setup
that's a pretty kick-ass Mono demo
Ryan Davis
@rdavisau
Aug 06 2015 02:04
that does sound pretty awesome
Aaron Stannard
@Aaronontheweb
Aug 06 2015 02:04
but yeah, I'd probably do a Docker setup on Ubuntu as well as Windows Server 2015
if I was going to do it
hey @cecilphillip, nice to see you in here man!
Cecil Phillip
@cecilphillip
Aug 06 2015 02:07
@Aaronontheweb Hey man. I'm in here randomly throughout the day
Aaron Stannard
@Aaronontheweb
Aug 06 2015 02:11
@cecilphillip awesome dude - glad to hear it!
and thanks for the suggestion - Docker is something that's been on my to-do list too
Cecil Phillip
@cecilphillip
Aug 06 2015 02:22
@Aaronontheweb Akka seems to be well suited for it too. I need to make time to get up to speed with it also
Cecil Phillip
@cecilphillip
Aug 06 2015 02:47
very cool
Aaron Stannard
@Aaronontheweb
Aug 06 2015 03:49
that is cool - never heard of the author before
nice to see new people getting involved!
Andrew Skotzko
@skotzko
Aug 06 2015 04:05
definitely
:thumbsup:
Ryan Davis
@rdavisau
Aug 06 2015 04:23
what's the best way for me to work out what HOCON settings are available to me?
Aaron Stannard
@Aaronontheweb
Aug 06 2015 04:23
in near future that will be in our docs
Ryan Davis
@rdavisau
Aug 06 2015 04:24
specifically I want to look at the Helios message size, but in general, is there somewhere I can look, or certain files I should check?
Aaron Stannard
@Aaronontheweb
Aug 06 2015 04:24
for the time being, look inside the Config folder inside the source of Akka.NET
Ryan Davis
@rdavisau
Aug 06 2015 04:24
:star: ty
(I'm embarrassed that I have to tell people to look into the source code for that info today) :fearful:
Ryan Davis
@rdavisau
Aug 06 2015 04:25
eh
at least we know it's up to date :+1:
Aaron Stannard
@Aaronontheweb
Aug 06 2015 04:32
@cecilphillip started watching some of the Pluralsight course
it's really good
I don't know how it'll occur for someone who's totally new to the idea of Akka.NET
but, I'm finding myself nodding in agreement throughout my listening of it
only in the early part of it though - like 20 minutes in
it's about 3.5 hours long total
Ryan Davis
@rdavisau
Aug 06 2015 04:56
checking out the new remote docs.. good stuff :+1:
Kyle Gobel
@KyleGobel
Aug 06 2015 05:17
well i swear i had searched for akka in pluralsight like two days ago and nothing came up
Ryan Davis
@rdavisau
Aug 06 2015 05:17
@KyleGobel me too; it's brand new!
Kyle Gobel
@KyleGobel
Aug 06 2015 05:17
oh, it's new..i see that now :)
Aaron Stannard
@Aaronontheweb
Aug 06 2015 05:50
came out yesterday
Kyle Gobel
@KyleGobel
Aug 06 2015 06:04
seems good so far, i wish he woulda had a section on different common actor patterns though
reading scalla is too hard for me :)
Bartosz Sypytkowski
@Horusiath
Aug 06 2015 07:46
@rogeralsing I want to try an experiment to switch default akka serializer to fspickler based one
Roger Johansson
@rogeralsing
Aug 06 2015 08:20
go for it :) do recall that there was something iffy about it, I've been down that route too, cant remember what it was though
Marc Piechura
@marcpiechura
Aug 06 2015 14:20
Can i watch the virtual meetup without a Google+ account?
Damian Reeves
@DamianReeves
Aug 06 2015 14:29
@Aaronontheweb a colleague of mine is going through the boot camp and has emailed you... Akka.Net is mentioned everyday at work... This is progress
Pluralsight course is great news
Aaron Stannard
@Aaronontheweb
Aug 06 2015 14:53
@Silv3rcircl3 yes, it'll be streamed live on YouTube too
let me get the link
@/all if you want to attend the virtual meetup in read-only mode or don't have a Google account, you can watch it here next week: https://www.youtube.com/watch?v=YuY1ziEqifU
Suhas Chatekar
@schatekar
Aug 06 2015 14:56
How long the virtual meet is for?
Aaron Stannard
@Aaronontheweb
Aug 06 2015 14:56
should be an hour
looks like myself and @annymsMthd will be presenting for about 20 minutes each
I'm excited for @annymsMthd's talk - he's going to share about how his company uses Akka.Cluster in production for IoT / real-time fleet tracking
Marc Piechura
@marcpiechura
Aug 06 2015 15:04
@Aaronontheweb cool thanks
Cecil Phillip
@cecilphillip
Aug 06 2015 15:07
@Aaronontheweb I've watched some of his other Pluralsight courses before. He's been doing a good job
Damian Reeves
@DamianReeves
Aug 06 2015 15:07
Any update on when we can expect 1.0.4?
Aaron Stannard
@Aaronontheweb
Aug 06 2015 15:08
@DamianReeves that's awesome Damian - did we respond to him? Sometimes I miss stuff :\
should be today - I finally got a necessary piece of build infrastructure for all of the Akka.Persistence plugins working last night
had to rewrite part of our FAKE script to do an integration test for each Akka.Persistence implementation against daily changes made to Akka.Persistence
Damian Reeves
@DamianReeves
Aug 06 2015 15:12
Cool, that discriminated Union bug and Akka persistence stuff is much anticipated
Aaron Stannard
@Aaronontheweb
Aug 06 2015 15:12
@DamianReeves I think we're still working on the DU fix :( cc @Horusiath
Aaron Stannard
@Aaronontheweb
Aug 06 2015 15:20
what I like about this pluralsight video is that he has a really concise way of explaining the power behind the concepts
like his explanation on how location transparency works is really well done
especially if you watch the remoting part later
Damian Reeves
@DamianReeves
Aug 06 2015 15:52
I was under the impression the remaining issues with the DU was when using DUs with Akka.FSharp... My actors are actually C#
Aaron Stannard
@Aaronontheweb
Aug 06 2015 15:54
@DamianReeves you are correct
Damian Reeves
@DamianReeves
Aug 06 2015 15:57
In a slightly related note, I have started work on a Fody weaver aimed at simplifying F# consumption from C#. Feature one is IL weaving exhausitive match functions for DUs
Bartosz Sypytkowski
@Horusiath
Aug 06 2015 16:25
@DamianReeves we had a hack around DU serialization/deserialization, but it couldn't handle all edge cases
you may see a discussion in PR #1203
Tamir Dresher
@tamirdresher
Aug 06 2015 17:48
Hi guys, have you heard about OzCode? its a really great visual extension we're developing that makes debugging in VS really fun.
take a look at http://www.oz-code.com/ and if you like we can make you a demo
Aaron Stannard
@Aaronontheweb
Aug 06 2015 17:53
@tamirdresher yes, I have heard of it! Saw the founders of it speak at DotNetFringe
it looked awesome
Tamir Dresher
@tamirdresher
Aug 06 2015 17:57
Thanks!!!
Christian Palmstierna
@cpx86
Aug 06 2015 18:05
@Aaronontheweb question about MultiNodeTestRunner: is there anything technically that requires a custom runner exe for multi-node tests, or is it built that way out of convenience?
Roger Johansson
@rogeralsing
Aug 06 2015 19:11
@haighis I sent som PR's for some hocon examples
Bartosz Sypytkowski
@Horusiath
Aug 06 2015 20:16
ok, I've finally created a hack for JObject deserialization (thx @rogeralsing for pointing me out correct way) that should work as long as we don't try to interop F# and C# actors
John Haigh
@haighis
Aug 06 2015 20:17
@rogeralsing thanks.. will review...am I able to merge these PR for you or does @Aaronontheweb or anyone else for that matter have the ability to merge them?
Roger Johansson
@rogeralsing
Aug 06 2015 20:25
sent you an invite to the contributors team, that should give you merge rights
Aaron Stannard
@Aaronontheweb
Aug 06 2015 20:30
@rogeralsing gotta press pause on the release today... found a show-stopper bug. Null reference exception with Sender. Not supposed to happen.
even if we pass in a null for sender inside Tell or Ask that's supposed to be converted to ActorRefs.Nobody i think
found it in an older nightly build and it happened again in this one, but the last stable release appears to be fine
@cpx yeah, the custom runner is necessary because the entire test succeeds or fails depending on how the test performed across each individual node
so we need some plumbing for launching 1 process per node and then collecting all of their test results into one place
if the nodes were a virtual thing like an AppDomain then we could probably get away with not needing that
@annymsMthd made a version of the test runner that worked that way but it failed much more often
Roger Johansson
@rogeralsing
Aug 06 2015 21:13
@Aaronontheweb nobody is null, we changed that some 2-3 months ago afaik
Or was that nosender ? Dont remember
stevemesser
@stevemesser
Aug 06 2015 21:17
Are receive predicates working in 1.0.3? I am typing in the code from todays pluralsight course and predicates don't appear to be working.
Roger Johansson
@rogeralsing
Aug 06 2015 21:18
There are tests for those, so Id be surprised if they don't work.
any specific case where it doesnt work?
stevemesser
@stevemesser
Aug 06 2015 21:21
I am using this Receive<PlayMovieMessage>( m => m.UserId == 42, HandlePlayMovieMessage);
Tried this for fun but the message was still processed Receive<PlayMovieMessage>(m => false, HandlePlayMovieMessage);
passing in userid of 41 and the message is still processed
stevemesser
@stevemesser
Aug 06 2015 21:40
Sorry, my bad. I changed the name of my message class but didn't change where is was created. Was sending message to actor without a predicate.
Weston
@ronnyek
Aug 06 2015 22:10
is there any sort of overlap with microsofts little actor thingy... as far as the whole I can model my actors as clients or something like that and when clients arent doing anything, free up resources
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:38
@rogeralsing then we need to revert that - because this is a breaking change
Receive<GetCurrentLifecycleStage>(stage =>
            {
                if(_currentSessionState != null)
                    Sender.Tell(_currentSessionState);
            });
Roger Johansson
@rogeralsing
Aug 06 2015 22:39
what about that code?
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:39
that code now throws an exception that it didn't before
specifically that Sender can be null
which it never could before
even if we made that change months ago, that introduces the need to nullcheck everywhere someone uses Sender.Tell
inherently a breaking change, no?
Roger Johansson
@rogeralsing
Aug 06 2015 22:40
um no, null should be possible to safely use as sender now
Tell(msg, null) should be all ok
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:41
then why does Sender.Tell throw a NullReferenceException?
Roger Johansson
@rogeralsing
Aug 06 2015 22:41
is the sender some special actorref in this case?
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:42
it's null - I have no idea :p
Roger Johansson
@rogeralsing
Aug 06 2015 22:42
Is Sender null?
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:42
yes!
blob
Sender should be a local actor in this case
Roger Johansson
@rogeralsing
Aug 06 2015 22:44
my bad, NoBody is still an object, NoSender however is null
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:44
hey man, no worries
glad we found it
Roger Johansson
@rogeralsing
Aug 06 2015 22:45
 public static class ActorRefs
    {
        public static readonly Nobody Nobody = Nobody.Instance;
        /// <summary>
        /// Use this value as an argument to <see cref="ICanTell.Tell"/> if there is not actor to
        /// reply to (e.g. when sending from non-actor code).
        /// </summary>
        public static readonly IActorRef NoSender = null;
    }
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:46
ah, that might do it
should we just change that back to an object then?
Roger Johansson
@rogeralsing
Aug 06 2015 22:46
hmmm I wonder what scala akka does in the cases where NoSender is passed as sender. as NoSender is null in scala too
thats why we introduced it
final val noSender: ActorRef = null
Aaron Stannard
@Aaronontheweb
Aug 06 2015 22:49
I wonder if they coalesce it into Nobody inside theActorCell
/*
   * ACTOR CONTEXT IMPLEMENTATION
   */

  final def sender(): ActorRef = currentMessage match {
    case null                      ⇒ system.deadLetters
    case msg if msg.sender ne null ⇒ msg.sender
    case _                         ⇒ system.deadLetters
  }
that explains it
sender is deadletters if null
Roger Johansson
@rogeralsing
Aug 06 2015 22:52
ah
weird that they use null and not NoSender in that code for clarity
anyway, I vote for doing the same, there is little reason to diverge from their impl if we can fix the problem by doing the same.
but it makes sense, e.g. if we pass nosender to a remote system, ofc that system should use its own deadletters
Aaron Stannard
@Aaronontheweb
Aug 06 2015 23:13
agree
Roger Johansson
@rogeralsing
Aug 06 2015 23:16
btw. Hocon, what namespace should it live in, keep it in Akka.Configuration even if its a separate lib?
(I saw that the akka prefix was removed in @haighis's PR, which is a big breaking change if Akka.NET is taking a dependency on it (which in itself is a breaking change, but not as much)
Alan Rutter
@AlanGRutter
Aug 06 2015 23:35
Just starting out with Akka.Net - going through the excellent bootcamp. Trying to use Akka.NET in my day job though got a beginner's problem. I have a ReceiveActor that registers for some events. When the event fires I'm trying to use Become() to change 'state' but I'm getting 'There is no active ActorContext, this is most likely due to use of async operations from within this actor.' exception. Can someone point me in the right direction.
Andrew Skotzko
@skotzko
Aug 06 2015 23:38
@alangrutter got a gist?
Anthony Brown
@bruinbrown
Aug 06 2015 23:38
@AlanGRutter When you receive an event, do you then do anything with a Task at all? E.g. do you call an async method. If you do, then you either need to mark your ReceiveActor handler as being async and await the task inside it or use PipeTo to send the result back to the actor as a message
@AlanGRutter Since the ActorContext is populated by the framework, it changes dependent upon the message, so if the task does some work and then returns to it, then it's likely that the ActorContext will have changed
Andrew Skotzko
@skotzko
Aug 06 2015 23:40
@AlanGRutter yeah you’re probably accessing something that changed / isn’t there anymore. Have a look at the PipeTo pattern
Alan Rutter
@AlanGRutter
Aug 06 2015 23:41
The event being subscribed to is raised via a COM object so it's not really async or a Task.
Anthony Brown
@bruinbrown
Aug 06 2015 23:42
Ah, so it's an event that's being triggered later on? In that case, once the event gets raised, I'd send a message to the actor working with it and handle it from there
If you're working in the event handler, then you won't have a correct ActorContext
Alan Rutter
@AlanGRutter
Aug 06 2015 23:43
``` public class IressActor : ReceiveActor
{
private DfsIress.Application _iressApplication;
    #region Messages

    public class Start
    {

    }

    #endregion

    public IressActor()
    {
        StartUp();
    }

    private void StartUp()
    {
        Receive<Start>(_ => HandleStart());
    }

    private void Offline()
    {
        Console.WriteLine("Offline!");
    }
    private void Online()
    {
        Console.WriteLine("Online!");
    }

    #region Message Type Handlers

    private void HandleStart()
    {
        Console.WriteLine("Starting Iress Actor");
        _iressApplication = new DfsIress.Application();
        _iressApplication.Online += _iressApplication_Online;
        _iressApplication.Offline += _iressApplication_Offline;
    }

    void _iressApplication_Offline()
    {
        this.Become(Offline);
    }

    void _iressApplication_Online()
    {
        Become(Online);
    }

    #endregion
ok that didn't quite format right but at least it;s readbale
John Haigh
@haighis
Aug 06 2015 23:44
@rogeralsing for the namespace i want your feedback as to how this should be .. I'll discuss on a PR..
Anthony Brown
@bruinbrown
Aug 06 2015 23:44
@AlanGRutter so in both of those event handlers send a message to Self with a message which conveys the information in that event handler, e.g. create a class for ApplicationOffline and ApplicationOnline and then add Receive handlers in the correct states which can handle those messages
Alan Rutter
@AlanGRutter
Aug 06 2015 23:49
I tried to use Self.Tell(new ApplicationOffline()) in the Offline event handler and get the same exception.
Anthony Brown
@bruinbrown
Aug 06 2015 23:52
You'll likely need an explicit reference to Self, since Self is another value which is updated by the framework
Alan Rutter
@AlanGRutter
Aug 06 2015 23:53
@bruinbrown - do you mean store a reference to Self in class variable?
Anthony Brown
@bruinbrown
Aug 06 2015 23:56
I'd probably be more inclined to use a variable in HandleStart and use anonymous methods instead of creating a delegate since the work the handlers do is pretty simple. But yeah, a class variable would also work, you just need to ensure that you've copied the Self variable somewhere you can use it later
Alan Rutter
@AlanGRutter
Aug 06 2015 23:59
@bruinbrown - just tried a class variable and that worked. With the anonymous method approach isn't there a problem of being unable to detach the handler and release resources?