Platform
Resources
Pricing
Sign in
Get started
Mike Bostock
Visualization toolmaker. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.
Workspace
Fork
Published
By
Mike Bostock
Edited
Mar 21, 2018
3 stars
Insert cell
Insert cell
PQueue
=
{
let
module
=
window
.
module
=
{
}
;
try
{
await
require
(
"p-queue"
)
;
}
catch
(
ignore
)
{
delete
window
.
module
;
return
module
.
exports
;
}
}
Insert cell
Insert cell
queue
=
new
PQueue
(
{
concurrency
:
4
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
let
queue
=
new
PQueue
(
{
concurrency
:
4
}
)
;
for
(
let
i
=
0
;
i
<
10
;
++
i
)
{
queue
.
add
(
async
(
)
=>
{
await
Promises
.
delay
(
500
)
;
}
)
;
}
await
queue
.
onIdle
(
)
;
return
"done"
;
}
Insert cell
Insert cell
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
PQueue
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
queue
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
active
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
waiting
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
delay
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML