Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use queueMicrotask on client
  • Loading branch information
feross committed Feb 10, 2021
commit d8bb9c53f71d08038da98b236c154e766df5eca5
3 changes: 2 additions & 1 deletion client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
})
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down