lib/pool-base.js
function() {
    firstTaskTimeout = clearTimeout(firstTaskTimeout);
    const task = taskQueue.shift();

    if (task) {
      const conn = idleConnections.shift();
      if (conn) {
        activeConnections[conn.threadId] = conn;
        resetTimeoutToNextTask();
        processTask(conn, task.sql, task.values, task.isBatch)
          .then(task.resolve)
          .catch(task.reject);
      } else {
        taskQueue.unshift(task);
      }
    }
  }
function() {
    firstTaskTimeout = clearTimeout(firstTaskTimeout);
    const task = taskQueue.shift();

    if (task) {
      const conn = idleConnections.shift();
      if (conn) {
        activeConnections[conn.threadId] = conn;
        resetTimeoutToNextTask();
        processTask(conn, task.sql, task.values, task.isBatch)
          .then(task.resolve)
          .catch(task.reject);
      } else {
        taskQueue.unshift(task);
      }
    }
  }
function ( ) { firstTaskTimeout = clearTimeout ( firstTaskTimeout ) ; const task = taskQueue . shift ( ) ; if ( task ) { const conn = idleConnections . shift ( ) ; if ( conn ) { activeConnections [ conn . threadId ] = conn ; resetTimeoutToNextTask ( ) ; processTask ( conn , task . sql , task . values , task . isBatch ) . then ( task . resolve ) . catch ( task . reject ) ; } else { taskQueue . unshift ( task ) ; } } }
Launch next waiting task request if available connections.
Launch next waiting task request if available connections .