public ComputeSession NewComputeStream(string sessionID) { if (!_disposing) { ComputeSession computeSession = new ComputeSession(sessionID, _accelerators[0], this); // preform load balancing magic here is supporting multiple accelerators _computeSessions.Add(computeSession); return(computeSession); } return(null); }
public ComputeSession FindComputeSession(string sessionID) { ComputeSession result = null; if (!_disposing) { result = _computeSessions?.Find(x => x.SessionID == sessionID); } return(null); }
public void ReturnSession(ComputeSession session) { if (session != null) { session.InActivate(); _computeSessions.Remove(session); if (!session.IsDisposing) { session.Dispose(); } } }