Skip to content

cluelesscoders/request-pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fe4253d · Apr 12, 2020

History

27 Commits
May 27, 2019
Jun 13, 2019
Jun 13, 2019
May 27, 2019
May 27, 2019
May 24, 2019
May 27, 2019
May 24, 2019
Apr 12, 2020
Jul 26, 2019
May 24, 2019
May 27, 2019

Repository files navigation

Request Pool

Creates a pool of request.

Features

  • Axios based request pool
  • Support for all axios request types.

Example

import { RequestPool } from '@cluelesscoders/request-pool';

const targets = [
    { url: 'http://testurl1/', method: 'GET' },
    { url: 'http://testurl2/', method: 'GET' },
    { url: 'http://testurl3/', method: 'POST', data: { test: 'data' } },
];

// limit two request at a time
const poolSize = 2;

const reqPool = new RequestPool(targets, poolSize);

// Get all responses including the failures
const responses = await reqPool.start();