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); }
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); }
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(); }
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; }