public IPointEmitter CreateEmitter(IPointEmitter parent, out Action dispose)
        {
            if (_client == null && !_emitters.Any())
            {
                dispose = null;
                return(parent);
            }

            if (parent != null)
            {
                throw new ArgumentException("Parent may not be specified here");
            }

            var result = new List <IPointEmitter>();

            if (_client != null)
            {
                var emitter = new HttpLineProtocolEmitter(_client);
                dispose = emitter.Dispose;
                result.Add(emitter);
            }
            else
            {
                dispose = () => { };
            }

            foreach (var emitter in _emitters)
            {
                result.Add(new DelegateEmitter(emitter));
            }

            return(new AggregateEmitter(result));
        }
Exemplo n.º 2
0
        public IPointEmitter CreateEmitter(IPointEmitter parent, out Action dispose)
        {
            if (parent != null)
            {
                throw new ArgumentException("Parent may not be specified here");
            }

            if (_client == null)
            {
                dispose = null;
                return(parent);
            }

            var emitter = new HttpLineProtocolEmitter(_client);

            dispose = emitter.Dispose;
            return(emitter);
        }