예제 #1
0
        /// <summary>
        /// If snapshot from <see cref="GetDeliverySnapshot"/> was saved, it will be received during recovery phase in a
        /// <see cref="SnapshotOffer"/> message and should be set with this method.
        /// </summary>
        /// <param name="snapshot"></param>
        public void SetDeliverySnapshot(AtLeastOnceDeliverySnapshot snapshot)
        {
            _deliverySequenceNr = snapshot.DeliveryId;
            var now = DateTime.UtcNow;
            var unconfirmedDeliveries = snapshot.UnconfirmedDeliveries
                                        .Select(u => new KeyValuePair <long, Delivery>(u.DeliveryId, new Delivery(u.Destination, u.Message, now, 0)));

            _unconfirmed = new ConcurrentDictionary <long, Delivery>(unconfirmedDeliveries);
        }
예제 #2
0
        /// <summary>
        /// If snapshot from <see cref="GetDeliverySnapshot" /> was saved it will be received during recovery
        /// phase in a <see cref="SnapshotOffer" /> message and should be set with this method.
        /// </summary>
        /// <param name="snapshot">TBD</param>
        public void SetDeliverySnapshot(AtLeastOnceDeliverySnapshot snapshot)
        {
            _deliverySequenceNr = snapshot.CurrentDeliveryId;
            DateTime now = DateTime.UtcNow;

            _unconfirmed =
                snapshot.UnconfirmedDeliveries.Select(
                    u => new KeyValuePair <long, Delivery>(u.DeliveryId, new Delivery(u.Destination, u.Message, now, 0)))
                .ToImmutableSortedDictionary();
        }
 /// <summary>
 /// If snapshot from <see cref="GetDeliverySnapshot" /> was saved it will be received during recovery
 /// phase in a <see cref="SnapshotOffer" /> message and should be set with this method.
 /// </summary>
 /// <param name="snapshot">TBD</param>
 public void SetDeliverySnapshot(AtLeastOnceDeliverySnapshot snapshot)
 {
     _atLeastOnceDeliverySemantic.SetDeliverySnapshot(snapshot);
 }
 /// <summary>
 ///     If snapshot from <see cref="GetDeliverySnapshot" /> was saved, it will be received during recovery phase in a
 ///     <see cref="SnapshotOffer" /> message and should be set with this method.
 /// </summary>
 /// <param name="snapshot"></param>
 public void SetDeliverySnapshot(AtLeastOnceDeliverySnapshot snapshot)
 {
     _atLeastOnceDeliverySemantic.SetDeliverySnapshot(snapshot);
 }
예제 #5
0
 public Snap(Akka.Persistence.AtLeastOnceDeliverySnapshot snapshot)
 {
     this.Snapshot = snapshot;
 }
        /// <summary>
        /// If snapshot from <see cref="GetDeliverySnapshot"/> was saved, it will be received during recovery phase in a
        /// <see cref="SnapshotOffer"/> message and should be set with this method.
        /// </summary>
        /// <param name="snapshot"></param>
        public void SetDeliverySnapshot(AtLeastOnceDeliverySnapshot snapshot)
        {
            _deliverySequenceNr = snapshot.DeliveryId;
            var now = DateTime.UtcNow;
            var unconfirmedDeliveries = snapshot.UnconfirmedDeliveries
                .Select(u => new KeyValuePair<long, Delivery>(u.DeliveryId, new Delivery(u.Destination, u.Message, now, 0)));

            _unconfirmed = new ConcurrentDictionary<long, Delivery>(unconfirmedDeliveries);
        }