JavaScript · Advanced · Ticket 8Ticket #44 · from Hannah Cole, Senior Engineer
  1. Example
  2. Warm-up 1
  3. Warm-up 2
  4. Ticket
Brief
NEW TICKET#44 · Attachments

Upload attachments a few at a time

Hannah Cole · Senior Engineer
Opened today

“When someone drops 40 receipts on an invoice, we start 40 uploads at once and the storage service starts refusing them. uploadAll should run at most limit uploads at the same time: as soon as one finishes, start the next. The results must come back in the same order as the files, whatever order the uploads finish in, because the screen matches them by position. Can you write it?”

YOUR PLAN
  1. 1Watch an example2 min
  2. 2Warm-up 11 min
  3. 3Warm-up 21 min
  4. 4Fix the ticket36 min
BY THE END YOU CAN
  • Run several async loops that share one counter
  • Store each result at its own index
  • Wait for a group of promises with Promise.all
About 40 minutes
Four short steps. Nothing is timed, and you can leave any time.