These are chat archives for akkadotnet/akka.net

9th
Jun 2017
Zetanova
@Zetanova
Jun 09 2017 04:18
@Arkatufus one major benefit to warp the correltionId-Guid is that the generation of the Guid itself can be postponed until something (serializaion) accesses it. So when it is not generated and not ref-equals then it is impossible that the guid-value of a deserilazed correlation would be equal
Zetanova
@Zetanova
Jun 09 2017 04:38
and of course instead to generate a guid, the correlation type could generate just a rnd long
zbynek001
@zbynek001
Jun 09 2017 07:50
Hi, I'm trying to use custom serialization for persistence, but running into issues serializing internal akka events & states that needs to be persisted (e.g. sharding events). Would it be possible to have them as public? Will make it easier surrogating stuff
JoshRun
@JoshRun
Jun 09 2017 17:21
Hello guys, I'm new to akka.net but I love it so far. Thanks for all the hardwork! I have a quick question when I recover from a persistent actor how do I know where I'm at in the processing of a workflow. I can persist and recover the data but how do I know which method I continue execution on?
Bartosz Sypytkowski
@Horusiath
Jun 09 2017 17:35
@JoshRun
  • I guess one way is to use PersistenceFSM
  • Another one is to have i.e. an enum persisted as part of state, which describes current behavior along with the behavior itself. Once you have replayed all events (override OnReplaySuccess), switch with Become() to a correct behavior based on that enum.
  • Most risky one is to have a persistent serializer that knows how to serialize delegates, and serialize current receive delegate directly. But that's pretty hardcore
JoshRun
@JoshRun
Jun 09 2017 18:02
Thanks Bartosz, The enum and become solution might work for me. I'll give it a shot. Thanks again.
Zetanova
@Zetanova
Jun 09 2017 18:10
@JoshRun what i am doing is to name the Enum flags like the behavior methods
then u can get the method delegate for the Become parameter by name
its now the wrong signeture
try { return (Action<IPNetReceiveBehavior>)Delegate.CreateDelegate(typeof(Action<IPNetReceiveBehavior>), this, name, true); } catch(ArgumentException ex) { throw new PNetException(String.Format("Receive Behavior '{0}' not found.", name), ex); }
Become(AboveFunction(State.Status.ToString()));
 protected override void OnReplaySuccess()
        {
            if (State == null)
                Become(Uninitialized);
            else
            {
                Become(GetConfigure(State.Status.ToString()));
            }

            base.OnReplaySuccess();
        }