public void PushToBusyList(MySQLHandler handler) { if (this.AvailableConnections.Contains(handler)) { this.AvailableConnections.Remove(handler); } }
public void PushToAvailable(MySQLHandler handler) { if (!this.AvailableConnections.Contains(handler)) { this.AvailableConnections.Add(handler); } this.NextCallback(); }
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]); } } }