Skip to content

Commit

Permalink
switch to queue microtask
Browse files Browse the repository at this point in the history
  • Loading branch information
jensengar committed Jan 31, 2024
1 parent 943a704 commit fcdd3af
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "stanza",
"name": "stanza-genesys",
"description": "Modern XMPP in the browser, with a JSON API",
"version": "12.19.1",
"author": "Lance Stout <lancestout@gmail.com>",
Expand Down
4 changes: 2 additions & 2 deletions src/platform/browser/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick, 0);
var timeout = queueMicrotask(cleanUpNextTick, 0);
draining = true;

var len = queue.length;
Expand Down Expand Up @@ -60,6 +60,6 @@ exports.nextTick = function (fun) {
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
setTimeout(drainQueue, 0);
queueMicrotask(drainQueue, 0);
}
};
18 changes: 18 additions & 0 deletions test/jingle/sdp/audio-video.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,37 +168,43 @@
"fecMechanisms": [],
"headerExtensions": [
{
"attributes": "",
"id": 1,
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level",
"attributes": ""
},
{
"attributes": "",
"id": 2,
"direction": "sendrecv",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
"attributes": ""
},
{
"id": 3,
"attributes": "",
"direction": "sendrecv",
"uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
"attributes": ""
},
{
"id": 4,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:sdes:mid",
"attributes": ""
},
{
"id": 5,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id",
"attributes": ""
},
{
"id": 6,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id",
"attributes": ""
Expand Down Expand Up @@ -856,72 +862,84 @@
"headerExtensions": [
{
"id": 14,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:toffset",
"attributes": ""
},
{
"id": 2,
"attributes": "",
"direction": "sendrecv",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
"attributes": ""
},
{
"id": 13,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:3gpp:video-orientation",
"attributes": ""
},
{
"id": 3,
"attributes": "",
"direction": "sendrecv",
"uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
"attributes": ""
},
{
"id": 12,
"attributes": "",
"direction": "sendrecv",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay",
"attributes": ""
},
{
"id": 11,
"attributes": "",
"direction": "sendrecv",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type",
"attributes": ""
},
{
"id": 7,
"attributes": "",
"direction": "sendrecv",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/video-timing",
"attributes": ""
},
{
"id": 8,
"attributes": "",
"direction": "sendrecv",
"uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07",
"attributes": ""
},
{
"id": 9,
"attributes": "",
"direction": "sendrecv",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/color-space",
"attributes": ""
},
{
"id": 4,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:sdes:mid",
"attributes": ""
},
{
"id": 5,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id",
"attributes": ""
},
{
"id": 6,
"attributes": "",
"direction": "sendrecv",
"uri": "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id",
"attributes": ""
Expand Down

0 comments on commit fcdd3af

Please sign in to comment.