From ac85999955883032f18d3bb141fe44e55ba3a294 Mon Sep 17 00:00:00 2001 From: nginnever Date: Wed, 17 Aug 2016 10:03:30 -0700 Subject: [PATCH] use modular async --- package.json | 2 +- src/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c45920a..198ed99 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/diasdavid/node-libp2p-kad-routing", "dependencies": { - "async": "^1.4.0", + "async": "^2.0.1", "buffer-xor": "^1.0.2", "ipfs-logger": "^0.1.0", "js-priority-queue": "^0.1.2", diff --git a/src/index.js b/src/index.js index b7d5090..f4df74e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ var KBucket = require('k-bucket') -var async = require('async') +var queue = require('async/queue') var log = require('ipfs-logger').group('peer-routing ipfs-kad-router') var protobufs = require('protocol-buffers-stream') var fs = require('fs') @@ -84,7 +84,7 @@ function KadRouter (peerSelf, swarmSelf, kBucketSize) { var peerList = {} // < b58Id : Peer > - var q = async.queue(queryPeer, 1) + var q = queue(queryPeer, 1) var closerPeers = self.kb.closest({ id: key, // key must be an Id object exported with .toBytes()