Esempio n. 1
0
        public virtual IRequestResult Accept(ISubscription subscription, IMessage message)
        {
            var bundle = new ProcessableUnit {
                Subscription = subscription, Message = message
            };

            Accepting(bundle);
            //RealizeIdentifier(subscription);
            BundlePrototype.IsNull(() => BundlePrototype = subscription);
            return(Result());
        }
Esempio n. 2
0
 public IProcessableUnit NextUnit()
 {
     return(new ContextHelper()
            .InContext(ctx => {
         var next = GetUnit(ctx);
         var result = default(IProcessableUnit);
         if (next.IsNotNull())
         {
             // TODO: Temporary cheat
             var subs = ctx.Subscriptions.Include("Qualities.SinkQuality").First(s => s.UniqueId == next.Subscription.UniqueId);
             result = new ProcessableUnit {
                 Subscription = Mapper.Map <PersistentSubscription, ISubscription>(subs),
                 Message = next.DehydratedMessage.Deserialize <IMessage>()
             };
         }
         return result;
     }));
 }