/// <summary> /// The sender wants to assign our internal value. /// </summary> /// <param name="m">M.</param> private void OnReceiveSetSomeValueMessage(SetSomeValueMessage m) { // Whenever internal state of an actor changes, we will save a snapshot. // Normally, actors will use a combination of events and snapshots for persistence. // We are exclusively using snapshots as an example. // see: https://getakka.net/articles/persistence/snapshots.html _heldValue = m.Value; SaveSnapshot(_heldValue); }
/// <summary> /// The sender wants to assign our internal value. /// </summary> /// <param name="m">M.</param> private void OnReceiveSetSomeValueMessage(SetSomeValueMessage m) { // Whenever internal state of an actor changes, we should persist that // as an event so actor recovery can replay those events to put the actor // in the correct state. Persist(new ValueAssignedEvent(m.Value), evt => { _heldValue = m.Value; }); }
/// <summary> /// The sender wants to assign our internal value. /// </summary> /// <param name="m">M.</param> private void OnReceiveSetSomeValueMessage(SetSomeValueMessage m) { _heldValue = m.Value; }