Example #1
0
 public Confirmable(IProjectable projectable, int count, int total, long expiresBy)
 {
     Projectable = projectable;
     Count       = count;
     Total       = total;
     ExpiresBy   = expiresBy;
 }
Example #2
0
 public void ProjectWith(IProjectable projectable, IProjectionControl control)
 {
     foreach (var entry in projectable.Entries)
     {
         switch (entry.Typed.Name)
         {
         case "OneHappened":
             _accessHolder.AccessProjection.WriteUsing(AccessProjection, 1);
             ProjectionControl.ConfirmerFor(projectable, control).Confirm();
             Logger.Debug("ONE");
             break;
         }
     }
     ProjectionControl.ConfirmerFor(projectable, control).Confirm();
 }
Example #3
0
        protected virtual void Dispatch(string dispatchId, IProjectable projectable)
        {
            var projections = ProjectionsFor(projectable.BecauseOf()).ToList();

            var count = projections.Count;

            if (count > 1)
            {
                _multiConfirming?.ManageConfirmationsFor(projectable, count);
            }

            foreach (var projection in projections)
            {
                projection.ProjectWith(projectable, count > 1 ? _multiConfirmingProjectionControl ! : _projectionControl !);
            }
        }
Example #4
0
        public bool NeedsProjection(object value)
        {
            Contract.Assert(value != null);

            if (value == null)
            {
                return(false);
            }

            IProjectable projector = value as IProjectable;

            if (projector != null && projector == this)
            {
                return(false);   // Already projected
            }
            // Different context, so we need to project it
            return(true);
        }
Example #5
0
 public void ProjectWith(IProjectable projectable, IProjectionControl control)
 {
     if (!actor.IsStopped)
     {
         Action <IProjection> cons1613435108 = __ => __.ProjectWith(projectable, control);
         if (mailbox.IsPreallocated)
         {
             mailbox.Send(actor, cons1613435108, null, ProjectWithRepresentation1);
         }
         else
         {
             mailbox.Send(new LocalMessage <IProjection>(actor, cons1613435108, ProjectWithRepresentation1));
         }
     }
     else
     {
         actor.DeadLetters?.FailedDelivery(new DeadLetter(actor, ProjectWithRepresentation1));
     }
 }
 public void ManageConfirmationsFor(IProjectable projectable, int count)
 {
     if (!actor.IsStopped)
     {
         Action <IMultiConfirming> cons1665207899 = __ => __.ManageConfirmationsFor(projectable, count);
         if (mailbox.IsPreallocated)
         {
             mailbox.Send(actor, cons1665207899, null, ManageConfirmationsForRepresentation1);
         }
         else
         {
             mailbox.Send(new LocalMessage <IMultiConfirming>(actor, cons1665207899,
                                                              ManageConfirmationsForRepresentation1));
         }
     }
     else
     {
         actor.DeadLetters?.FailedDelivery(new DeadLetter(actor, ManageConfirmationsForRepresentation1));
     }
 }
        public Confirmer ConfirmerFor(IProjectable projectable, IProjectionControl control)
        {
            if (!actor.IsStopped)
            {
                Action <IProjectionControl> cons609358827 = __ => __.ConfirmerFor(projectable, control);
                if (mailbox.IsPreallocated)
                {
                    mailbox.Send(actor, cons609358827, null, ConfirmerForRepresentation1);
                }
                else
                {
                    mailbox.Send(
                        new LocalMessage <IProjectionControl>(actor, cons609358827, ConfirmerForRepresentation1));
                }
            }
            else
            {
                actor.DeadLetters?.FailedDelivery(new DeadLetter(actor, ConfirmerForRepresentation1));
            }

            return(null);
        }
 public void ProjectWith(IProjectable projectable, IProjectionControl control) => UpsertFor(projectable, control);
 public void ProjectWith(IProjectable projectable, IProjectionControl control) =>
 control.ConfirmProjected(projectable.ProjectionId);
Example #10
0
 public static Confirmer ConfirmerFor(IProjectable projectable, IProjectionControl control)
 => new Confirmer(() => control.ConfirmProjected(projectable.ProjectionId));
Example #11
0
 public void Init(IProjectable projectable)
 {
     //goal = initTrigger;
     enabled = true;
     gameObject.SetActive(true);
 }
 public void ProjectWith(IProjectable projectable, IProjectionControl control) =>
 Access.WriteUsing("projections", 1, projectable.DataId);
Example #13
0
 public Confirmer ConfirmerFor(IProjectable projectable, IProjectionControl control) => ProjectionControl.ConfirmerFor(projectable, control);
Example #14
0
        //==========================
        // MultiConfirming
        //==========================

        public void ManageConfirmationsFor(IProjectable projectable, int count)
        {
            var expiresBy = DateTimeHelper.CurrentTimeMillis() + _expiration;

            _confirmables.Add(projectable.ProjectionId, new Confirmable(projectable, count, 0, expiresBy));
        }