function close (callback) {
  if (globalConnection) {
    const gc = globalConnection
    globalConnection = null
    return gc.close(callback)
  }

  if (typeof callback === 'function') {
    setImmediate(callback)
    return null
  }

  return new shared.Promise((resolve) => {
    resolve(globalConnection)
  })
}
/**
 * Close all active connections in the global pool.
 *
 * @param {basicCallback} [callback] A callback which is called after connection has closed, or an error has occurred. If omited, method returns Promise.
 * @return {ConnectionPool|Promise}
 */
Close all active connections in the global pool.
@param {basicCallback} [callback] A callback which is called after connection has closed, or an error has occurred. If omited, method returns Promise.
Close all active connections in the global pool . @param { basicCallback } [ callback ] A callback which is called after connection has closed or an error has occurred . If omited method returns Promise .
function close (callback) {
  if (globalConnection) {
    const gc = globalConnection
    globalConnection = null
    return gc.close(callback)
  }
  if (typeof callback === 'function') {
    setImmediate(callback)
    return null
  }
  return new shared.Promise((resolve) => {
    resolve(globalConnection)
  })
}
function close ( callback ) { if ( globalConnection ) { const gc = globalConnection globalConnection = null return gc . close ( callback ) } if ( typeof callback === 'function' ) { setImmediate ( callback ) return null } return new shared . Promise ( ( resolve ) => { resolve ( globalConnection ) } ) }
Close all active connections in the global pool.
Close all active connections in the global pool .