public SerializedErrorsInbox(IErrorsBacklog errorsBacklog) { _errorsBacklog = errorsBacklog; _errors = new Subject <ErrorPayload>(); _publishedErrors = _errors.Publish().RefCount(); }
public QueriesFactory(IErrorsInbox errorsInbox, IErrorsBacklog errorsBacklog, IErrorsBacklogReader errorsBacklogReader, IVisibilityPublisher visibilityPublisher, IVisibilityPersistor visibilityPersistor, IBackendNotifier backendNotifier, params Func <IBackendQuery>[] subscriptors) { _errorsInbox = errorsInbox; _errorsBacklog = errorsBacklog; _errorsBacklogReader = errorsBacklogReader; _visibilityPublisher = visibilityPublisher; _visibilityPersistor = visibilityPersistor; _backendNotifier = backendNotifier; _subscriptors = subscriptors; }
public QueuedErrorsInbox(IErrorsBacklog errorsBacklog) { _errorsBacklog = errorsBacklog; Task.Run(() => { //it will block here automatically waiting from new items to be added and it will not take cpu down foreach (var data in _queue.GetConsumingEnumerable()) { _errors.OnNext(data); } }); _errors = new Subject <ErrorPayload>(); _publishedErrors = _errors.Publish().RefCount(); }