public PipeWatcherProxy(IPipeLineWatcher watcher, string dataFlowKey, DataFlowOption option)
        {
            if (!string.IsNullOrEmpty(dataFlowKey))
            {
                _dataFlowKey = dataFlowKey;
                _publisher   = DataFlowFactory.RegisterFlow <WatchDataItem>(dataFlowKey, WatchCallBack, option);
            }
            else
            {
                _watchDataQueue = new ActionBlock <WatchDataItem>(WatchCallBack,
                                                                  new ExecutionDataflowBlockOptions()
                {
                    MaxDegreeOfParallelism = 4
                });
            }

            _watcher = watcher;
        }
 /// <inheritdoc />
 protected override void RegisterSubscriber(string pipeDataKey, IDataSubscriber <TMsg> subscriber)
 {
     DataFlowFactory.RegisterSubscriber(pipeDataKey, subscriber);
 }
Beispiel #3
0
 /// <inheritdoc />
 protected override IDataPublisher CreatePublisher(DataPublisherOption option)
 {
     return(DataFlowFactory.CreatePublisher(option));
 }
Beispiel #4
0
 protected override IDataPublisher CreateFlow(string pipeDataKey, IDataSubscriber <TContext> subscriber, DataFlowOption option)
 {
     return(DataFlowFactory.RegisterFlow(pipeDataKey, subscriber, option));
 }