public void Process(StreamMode mode, StreamData data, Action <byte[], int> callback) { if (!_disposed) { var request = new AsyncStreamRequest(mode, data, callback); var task = new StreamTask(GetIdleUnit(), request); ThreadPool.QueueUserWorkItem(_ => { task.Run(); }); } }
public StreamTask(StreamUnit streamUnit, AsyncStreamRequest request) { _streamUnit = streamUnit; _request = request; _streamUnit.Busy = true; }