コード例 #1
0
 public void PushToBusyList(MySQLHandler handler)
 {
     if (this.AvailableConnections.Contains(handler))
     {
         this.AvailableConnections.Remove(handler);
     }
 }
コード例 #2
0
        public void PushToAvailable(MySQLHandler handler)
        {
            if (!this.AvailableConnections.Contains(handler))
            {
                this.AvailableConnections.Add(handler);
            }

            this.NextCallback();
        }
コード例 #3
0
        public void NextCallback()
        {
            while (this.AvailableConnections.Count > 0 && this.waitingCallback.Count > 0)
            {
                MySQLHandler handler = this.AvailableConnections[0];
                this.AvailableConnections.RemoveAt(0);
                var callback = this.waitingCallback[0];
                this.waitingCallback.RemoveAt(0);

                if (callback[1] == null)
                {
                    handler.start(callback[0]);
                    handler.Execute();
                }
                else
                {
                    handler.start(callback[0]);
                    handler.ExecuteAndFetch(callback[1], callback[2]);
                }
            }
        }