1.5.3 • Published 7 years ago

multi-request v1.5.3

Weekly downloads
15
License
ISC
Repository
-
Last release
7 years ago

Multi Process Request

A request.js (https://www.npmjs.com/package/request) wrapper that support multi process request.

Installation

$ npm install multi-request

Usage

Just require the module like this: var MRequest = require("multi-request")

Callback style

MRequest("http://google.com",function(err,response,body){
	// do something
})

Promise style

MRequest("http://google.com").then(function(result){
	var response = result.response;
	var body = result.body;
}).catch(console.error)

Manage Worker usage

By default, multi-request will spawn maximum cpuLoad * cpuCount. You can change cpuLoad by calling .changeCpuLoad(num). For example :

MRequest.changeCpuLoad(3)

will set maximum Worker count to 3 * cpuCount. Please be alerted that currently multi-request only support expanding maximum worker count. If you try to call changeCpuLoad with parameter less than any subsequent call, it will not resulted in decreased running Worker. This feature is planned for future release.

How does it works?

multi-request initially spawn 1 Worker. As the request grows, multi-request will try spawn new Worker until maximum worker count is reached. For each API invocation, parameters that passed to API will be sent to a child process based on round-robin technique. Multi Process Request support request.js parameter, but still untested for file handling.

GitHub

https://github.com/aerios/multi-request

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.2.5

8 years ago

1.3.0

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago