示例#1
0
 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);
 }
示例#2
0
        public ComputeSession FindComputeSession(string sessionID)
        {
            ComputeSession result = null;

            if (!_disposing)
            {
                result = _computeSessions?.Find(x => x.SessionID == sessionID);
            }

            return(null);
        }
示例#3
0
        public void ReturnSession(ComputeSession session)
        {
            if (session != null)
            {
                session.InActivate();

                _computeSessions.Remove(session);

                if (!session.IsDisposing)
                {
                    session.Dispose();
                }
            }
        }