Re: [webrtc-pc] Operations "queue" is a misnomer. Confuses people. (#2227)

To illustrate the difference between a (main thread) task and an operetion:

This click triggers one task (one synchronous operation):
```js
button.onclick = () => {
    video1.pause();
    video2.pause();
    video3.pause();
}
```
This click triggers 3 tasks (one asynchronous operation):
```js
button.onclick = async () => {
    await video1.play();
    await video2.play();
    await video3.play();
}
```
...because it is syntactic sugar for:
```js
button.onclick = () => {
  return video1.play()          // synchronously invoked
    .then(() => video2.play())  // a callback
    .then(() => video3.play()); // another callback
}
```
(A fourth task may resolve the final returned promise, but it might be GC'ed since it's unused).

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2227#issuecomment-510969504 using your GitHub account

Received on Friday, 12 July 2019 17:32:17 UTC