millirud / minio-pool

Minio connections pool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minio-pool

Minio connections pool

Usage example

const Pool = require('minio-pool)

// Init pool
const pool = new Pool({
    endPoint: 'localhost',
    port: 9000,
    useSSL: false,
    accessKey: 'AKIAIOSFODNN7EXAMPLE',
    secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
    poolSize: 5,
    pendingTimeout: 5000
})

// Get minio client 
const client =  await pool.connect()

// Execute minio function
const res = await client.bucketExists('test')

// Return client to available pool
pool.release(client)

Options

  • poolSize - Max limit clients in pool. Default 10
  • pendingTimeout - Timeout waiting for client in ms. Default 15000

About

Minio connections pool

License:MIT License


Languages

Language:JavaScript 100.0%