Пример #1
0
        private StreamUnit GetIdleUnit()
        {
            int count = _unitPool.Count;

            for (int i = 0; i < count; ++i)
            {
                var unit = _unitPool[i];
                if (!unit.Busy)
                {
                    return(unit);
                }
            }

            var newUnit = new StreamUnit(_algorithm);

            _unitPool.Add(newUnit);

            return(newUnit);
        }
Пример #2
0
 public StreamTask(StreamUnit streamUnit, AsyncStreamRequest request)
 {
     _streamUnit      = streamUnit;
     _request         = request;
     _streamUnit.Busy = true;
 }
Пример #3
0
 public StreamSyncProcessor(StreamAlgorithm algorithm)
 {
     _streamUnit = new StreamUnit(algorithm);
 }