Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:05
    IgorFedchenko commented #4085
  • 03:08
    hhko commented #4094
  • Dec 13 21:37
    Aaronontheweb commented #4085
  • Dec 13 20:28
    IgorFedchenko commented #4085
  • Dec 13 20:27
    IgorFedchenko commented #4085
  • Dec 13 15:38
    Aaronontheweb labeled #4096
  • Dec 13 15:38
    Aaronontheweb milestoned #4096
  • Dec 13 15:38
    Aaronontheweb labeled #4096
  • Dec 13 15:38
    Aaronontheweb opened #4096
  • Dec 13 10:41
    peirens-bart opened #4095
  • Dec 13 08:37
    Aaronontheweb synchronize #4071
  • Dec 13 08:13
    jiyeongj opened #4094
  • Dec 12 15:42
    Aaronontheweb synchronize #4086
  • Dec 12 15:42
    Aaronontheweb closed #4083
  • Dec 12 15:42

    Aaronontheweb on dev

    Fix #4083 - Endpoint receive bu… (compare)

  • Dec 12 15:42
    Aaronontheweb closed #4089
  • Dec 12 15:42
    Aaronontheweb labeled #4093
  • Dec 12 15:42
    Aaronontheweb labeled #4093
  • Dec 12 15:42
    Aaronontheweb labeled #4093
  • Dec 12 15:42
    Aaronontheweb opened #4093
Aaron Stannard
@Aaronontheweb
would love to use that for troubleshooting issues with the performance-critical parts
Ashit Shakrani
@ashshak
Hi Guys,
I am just spiking the FSM and can't get it to transition to the 2nd state, am I missing anything here:
public MyFsm()
        {
            MyStates myStates = new MyStates(); 
            StartWith(myStates.Ready, new MyData());

            When(myStates.Ready, @event =>
            {
                State<MyState, MyData> nextState=null;

                @event.FsmEvent.Match()
                    .With<MyEvents.Calculate>(calculate =>
                    {
                        StateData.Item1 = calculate.Item1;
                        StateData.Item2 = calculate.Item2;
                        nextState = GoTo(myStates.Calculating, StateData);
                    })
                    .Default(o =>
                    {
                        nextState = Stay();
                    });

                return nextState;
            });

            When(myStates.Calculating, @event =>
            {
                StateData.Sum = StateData.Item1 + StateData.Item2;
                return GoTo(myStates.Calculated, StateData);
            });
            Initialize();
        }
Aaron Stannard
@Aaronontheweb
@ashshak can you show the full FSM code along with the messages you're sending it?
Ashit Shakrani
@ashshak
sure, here a gist:
https://gist.github.com/ashshak/211a7323a78065558b43
Thanks for having a look.
Aaron Stannard
@Aaronontheweb
ah, I think I may know why.. can you verify that the GoTo(myStates.Calculating, StateData) is being called?
with the debugger?
Ashit Shakrani
@ashshak
yes the event is being pattern-matched and nextState is being set.
Aaron Stannard
@Aaronontheweb
ok, I think I might know what's up
this is from the internals of the FSM<TState, TData> class
private void ProcessEvent(Event<TData> fsmEvent, object source)
        {
            if(DebugEvent)
            {
                var srcStr = GetSourceString(source);
                _log.Debug("processing {0} from {1}", fsmEvent, srcStr);
            }
            var stateFunc = _stateFunctions[_currentState.StateName];
            var oldState = _currentState;
            State<TState, TData> upcomingState = null;

            if(stateFunc != null)
            {
                upcomingState = stateFunc(fsmEvent);
            }

            if(upcomingState == null)
            {
                upcomingState = HandleEvent(fsmEvent);
            }

            ApplyState(upcomingState);
            if(DebugEvent && !Equals(oldState, upcomingState))
            {
                _log.Debug("transition {0} -> {1}", oldState, upcomingState);
            }
        }
this is where a state transition occurs
the stateFunc this in case is your lambda inside the Where( clause
ah, nevermind - I'm an idiot
turn on the following setting in HOCON
Ashit Shakrani
@ashshak
yup, I saw the source file. And even the handler for OnTransition() is firing. But it never enters the stateFunc of the 2nd state.
Aaron Stannard
@Aaronontheweb
akka.loglevel = DEBUG
this will print out the _log.Debug("transition {0} -> {1}", oldState, upcomingState); messages to the console
so you'll know for certain if the transition occurs
I think you are transitioning to the second state
but you need to send another event
right now nothing is handled in that state
events don't cascade
they're handled and cause a transition
Ashit Shakrani
@ashshak
ok, I see. I have just fired another message and it now hits handler. I thought I could just move from one to another. Thanks for your help.
Aaron Stannard
@Aaronontheweb
no worries @ashshak - it was a good gut check for me too
the thing I was worried about was using nullable types to define states
since we do so many STATE1 == STATE2 comparisons
but you handled that by using singletons
we really need to document FSMs anyway - @skotzko just put together a big sample the other day showing how to unit test them
Ashit Shakrani
@ashshak
Where can I find that. http://getakka.net/docs/FSM seems incomplete to me as it there are no GoTo s. Your markedup blog post for FSM was helpful.
Aaron Stannard
@Aaronontheweb
we'll be publishing it soon - the getakka.net docs for the FSM are scarce
@rogeralsing @Horusiath btw, this is supposed to be getting merged today Azure/DotNetty#40
has all of the stuff needed to replace Helios AFAIK
Roger Johansson
@rogeralsing
nice!
Aaron Stannard
@Aaronontheweb
only thing missing is the multi-threaded event loop
which helps throughput across multiple connections
makes no difference over a 1:1 connection
Arjen Smits
@Danthar
Commit message Motivation: Let me guess. commit messages are mandatory ? ^^
Aaron Stannard
@Aaronontheweb
lol what's that from?
Arjen Smits
@Danthar
o wait. its followed by a newline :D
Azure/DotNetty@0722ade
Aaron Stannard
@Aaronontheweb
haha
Max has a very precise communication style
Arjen Smits
@Danthar
System.Diagnostics.Contract stuff is great. Been using it more and more in my own code as well
l3igmike
@l3igmike
is it possible to kill an actor, recreate it somewhere else and include its former mailbox messages?
Aaron Stannard
@Aaronontheweb
@l3igmike Akka.Persistence can do this
backs up its state, but not its messages, to a durable store
Yin Zhang
@melcloud
Morning guys. Is there a way to filter out death watch and heartbeat log message under debug? I want to see all sent/receive messages between two remote nodes, but those heartbeat message are rally annoying! :smile:
Aaron Stannard
@Aaronontheweb
if you're debugging Akka.Remote
or Cluster