Example #1
0
        /// <summary>
        /// Add the session to queue
        /// </summary>
        /// <param name="key">session Id</param>
        /// <param name="session">current session</param>
        /// <returns></returns>
        public bool AddSessionToCreateToQueue(long key, Session session)
        {
            bool retVal = false;

            sessionsDone = false;
            if (!dbSavingTime.IsRunning)
            {
                dbSavingTime.Restart();
            }

            SessionsQueueToCreate.Enqueue(session);

            return(retVal);
        }
Example #2
0
        public void Dispose()
        {
            workerTokenSrc.Cancel();
            StopRlmDbWorkersSessions();
            StopRlmDbWorkersCases();

            BestSolutions?.Clear();
            BestSolutionStaging?.Clear();
            Sessions?.Clear();
            Rneurons?.Clear();
            Solutions?.Clear();

            if (SessionsQueueToCreate != null && SessionsQueueToCreate.Count > 0)
            {
                Session removedSess;
                foreach (var item in SessionsQueueToCreate)
                {
                    SessionsQueueToCreate.TryDequeue(out removedSess);
                }
            }

            if (SessionsQueueToUpdate != null && SessionsQueueToUpdate.Count > 0)
            {
                Session removedSess;
                foreach (var item in SessionsQueueToUpdate)
                {
                    SessionsQueueToUpdate.TryDequeue(out removedSess);
                }
            }

            DynamicInputs?.Clear();
            DynamicOutputs?.Clear();

            if (GPUMode)
            {
                if (rneuronProcessor is IDisposable)
                {
                    (rneuronProcessor as IDisposable).Dispose();
                }
            }
        }