Skip to content

Commit 29e1e93

Browse files
committed
Add linkedlist
1 parent e76e69a commit 29e1e93

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,26 @@
3939
"./lib/cjs/util/multipart.js": "./lib/cjs/util/multipart.web.js",
4040
"./lib/cjs/util/request.js": "./lib/cjs/util/request.web.js"
4141
},
42-
"files": ["lib/*.*", "lib/cjs/*.*", "lib/cjs/util/*.*"],
42+
"files": [
43+
"lib/*.*",
44+
"lib/cjs/*.*",
45+
"lib/cjs/util/*.*"
46+
],
4347
"scripts": {
44-
"test":
45-
"mocha --growl --reporter spec --require source-map-support/register --require core-js/shim --timeout 10000 lib/cjs/test",
48+
"test": "mocha --growl --reporter spec --require source-map-support/register --require core-js/shim --timeout 10000 lib/cjs/test",
4649
"pretest": "yarn dist",
47-
"ci":
48-
"mocha --reporter spec --require source-map-support/register --require core-js/shim --timeout 10000 lib/cjs/test",
50+
"ci": "mocha --reporter spec --require source-map-support/register --require core-js/shim --timeout 10000 lib/cjs/test",
4951
"preci": "yarn install",
5052
"jenkins": "yarn ci -- --timeout 0 --reporter xunit-file",
5153
"dist:cjs": "tsc -p . --outDir ./lib/cjs/ && cpy src/index.js lib/cjs/",
52-
"dist:async":
53-
"tsc -p . --outDir ./lib/async/ --target es2017 && cpy src/index.js lib/async/",
54+
"dist:async": "tsc -p . --outDir ./lib/async/ --target es2017 && cpy src/index.js lib/async/",
5455
"dist:web": "webpack",
55-
"dist":
56-
"rimraf lib && npm-run-all --parallel dist:* && cpy src/index.all.js --rename index.js lib/",
56+
"dist": "rimraf lib && npm-run-all --parallel dist:* && cpy src/index.all.js --rename index.js lib/",
5757
"prepublish": "yarn dist && node -e 'require(\".\");'"
5858
},
5959
"dependencies": {
6060
"es6-error": "^4.0.1",
61+
"linkedlist": "^1.0.1",
6162
"multi-part": "^2.0.0",
6263
"utf8-length": "^0.0.1",
6364
"xhr": "^2.4.1"

src/connection.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { Route } from "./route";
1111
import { byteLength } from "./util/bytelength";
1212
import { stringify as querystringify } from "querystring";
1313

14+
const LinkedList = require("linkedlist/lib/linkedlist") as typeof Array;
15+
1416
const MIME_JSON = /\/(json|javascript)(\W|$)/;
1517
const LEADER_ENDPOINT_HEADER = "x-arango-endpoint";
1618

@@ -73,7 +75,7 @@ export class Connection {
7375
private _loadBalancingStrategy: LoadBalancingStrategy;
7476
private _useFailOver: boolean;
7577
private _maxTasks: number;
76-
private _queue: Task[] = [];
78+
private _queue: Task[] = new LinkedList();
7779
private _hosts: RequestFunction[] = [];
7880
private _urls: string[] = [];
7981
private _activeHost: number;

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,6 +2373,10 @@ levn@^0.3.0, levn@~0.3.0:
23732373
prelude-ls "~1.1.2"
23742374
type-check "~0.3.2"
23752375

2376+
linkedlist@^1.0.1:
2377+
version "1.0.1"
2378+
resolved "https://registry.yarnpkg.com/linkedlist/-/linkedlist-1.0.1.tgz#7b74189bfad6e76367fb5a10f3c36913128b782b"
2379+
23762380
load-json-file@^1.0.0:
23772381
version "1.1.0"
23782382
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"

0 commit comments

Comments
 (0)