source:
frontend/node_modules/fastq/example.mjs
| Last change on this file was 9af201e, checked in by , 11 days ago | |
|---|---|
|
|
| File size: 199 bytes | |
| Line | |
|---|---|
| 1 | import { promise as queueAsPromised } from './queue.js' |
| 2 | |
| 3 | const queue = queueAsPromised(worker, 1) |
| 4 | |
| 5 | console.log('the result is', await queue.push(42)) |
| 6 | |
| 7 | async function worker (arg) { |
| 8 | return 42 * 2 |
| 9 | } |
Note:
See TracBrowser
for help on using the repository browser.
