示例#1
0
 public void Start()
 {
     Logger.Info("Mail queue started");
     IsAlive      = true;
     Subscription =
         ChangeNotification.Track <IMailMessage>()
         .Buffer(BufferTimeout, BufferCount)
         .Subscribe(_ => Task.Factory.StartNew(ProcessAll));
     Task.Factory.StartNew(ProcessAll);
 }
示例#2
0
 public void Start()
 {
     TraceSource.TraceEvent(TraceEventType.Start, 1011);
     IsAlive      = true;
     Subscription =
         ChangeNotification.Track <IMailMessage>()
         .Buffer(BufferTimeout, BufferCount)
         .Subscribe(_ => Task.Factory.StartNew(ProcessAll));
     Task.Factory.StartNew(ProcessAll);
 }
示例#3
0
        public SingleDomainEventSource(IDataChangeNotification notifications)
        {
            Contract.Requires(notifications != null);

            Subscription =
                notifications.Track <TEvent>().Subscribe(kv =>
            {
                foreach (var ev in kv.Value.Value)
                {
                    Subject.OnNext(ev);
                }
            });
            Events = Subject.AsObservable();
        }
示例#4
0
        public ChangeNotifications(IDataChangeNotification notifications)
        {
            Subscription = notifications.Track <TSource>().Subscribe(kv => Subject.OnNext(kv));
            var source = Subject.AsObservable();

            BulkChanges = source.Select(it => it.Value);
            LazyChanges =
                from it in source
                let lazy = it.Value
                           from i in Enumerable.Range(0, it.Key.Length)
                           select new Lazy <TSource>(() => lazy.Value[i]);

            EagerChanges =
                from it in source
                from v in it.Value.Value
                select v;
        }