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); }
public StreamTask(StreamUnit streamUnit, AsyncStreamRequest request) { _streamUnit = streamUnit; _request = request; _streamUnit.Busy = true; }
public StreamSyncProcessor(StreamAlgorithm algorithm) { _streamUnit = new StreamUnit(algorithm); }