mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 04:01:35 +00:00
Use queueMicrotask on client
This commit is contained in:
parent
0c4911eaea
commit
d8bb9c53f7
@ -3,6 +3,7 @@ const EventEmitter = require('events')
|
||||
const once = require('once')
|
||||
const parallel = require('run-parallel')
|
||||
const Peer = require('simple-peer')
|
||||
const queueMicrotask = require('queue-microtask')
|
||||
|
||||
const common = require('./lib/common')
|
||||
const HTTPTracker = require('./lib/client/http-tracker') // empty object in browser
|
||||
@ -76,7 +77,7 @@ class Client extends EventEmitter {
|
||||
const webrtcSupport = this._wrtc !== false && (!!this._wrtc || Peer.WEBRTC_SUPPORT)
|
||||
|
||||
const nextTickWarn = err => {
|
||||
process.nextTick(() => {
|
||||
queueMicrotask(() => {
|
||||
this.emit('warning', err)
|
||||
})
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
"lru": "^3.1.0",
|
||||
"minimist": "^1.2.5",
|
||||
"once": "^1.4.0",
|
||||
"queue-microtask": "^1.2.2",
|
||||
"random-iterate": "^1.0.1",
|
||||
"randombytes": "^2.1.0",
|
||||
"run-parallel": "^1.1.9",
|
||||
|
Loading…
Reference in New Issue
Block a user