GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http: set lifo as the default scheduling strategy in Agent · nodejs/node@f70aee0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • http.md
  • lib
    • _http_agent.js
  • test/parallel
    • test-http-agent-scheduling.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/http.md‎

Copy file name to clipboardExpand all lines: doc/api/http.md
+4-1Lines changed: 4 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ http.get({
113113
<!-- YAML
114114
added: v0.3.4
115115
changes:
116+
- version: REPLACEME
117+
pr-url: https://github.com/nodejs/node/pull/36685
118+
description: Change the default scheduling from 'fifo' to 'lifo'.
116119
- version: v14.5.0
117120
pr-url: https://github.com/nodejs/node/pull/33617
118121
description: Add `maxTotalSockets` option to agent constructor.
@@ -157,7 +160,7 @@ changes:
157160
In case of a high rate of request per second,
158161
the `'fifo'` scheduling will maximize the number of open sockets,
159162
while the `'lifo'` scheduling will keep it as low as possible.
160-
**Default:** `'fifo'`.
163+
**Default:** `'lifo'`.
161164
* `timeout` {number} Socket timeout in milliseconds.
162165
This will set the timeout when the socket is created.
163166

Collapse file

‎lib/_http_agent.js‎

Copy file name to clipboardExpand all lines: lib/_http_agent.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function Agent(options) {
9494
this.keepAlive = this.options.keepAlive || false;
9595
this.maxSockets = this.options.maxSockets || Agent.defaultMaxSockets;
9696
this.maxFreeSockets = this.options.maxFreeSockets || 256;
97-
this.scheduling = this.options.scheduling || 'fifo';
97+
this.scheduling = this.options.scheduling || 'lifo';
9898
this.maxTotalSockets = this.options.maxTotalSockets;
9999
this.totalSocketCount = 0;
100100

Collapse file

‎test/parallel/test-http-agent-scheduling.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-agent-scheduling.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ function defaultTest() {
5656

5757
bulkRequest(url, agent, (ports) => {
5858
makeRequest(url, agent, (port) => {
59-
assert.strictEqual(ports[0], port);
59+
assert.strictEqual(ports[ports.length - 1], port);
6060
makeRequest(url, agent, (port) => {
61-
assert.strictEqual(ports[1], port);
61+
assert.strictEqual(ports[ports.length - 1], port);
6262
makeRequest(url, agent, (port) => {
63-
assert.strictEqual(ports[2], port);
63+
assert.strictEqual(ports[ports.length - 1], port);
6464
server.close();
6565
agent.destroy();
6666
});

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.