Congratulations, you made it to the end of the course! Ashdown Libraries’ holds check now runs in JavaScript. On the first morning, branch-status.js prints the same seven lines as Owen’s branch_status.py, from Northgate: 14 holds waiting to Checked 4 kiosks in 0.5 s. Hollins Green shows no answer, Quarry Hill’s three holds arrive on its second try, and the second morning prints Yesterday: 26.
In Porting the Holds Check, you rebuilt the script up to the board and the total. In the exercise Finish the Holds Check, you completed it, loading yesterday’s total while querying the kiosks, writing today’s total to the history file, and timing the check.
In this course, you learned how to:
- Port
async defto anasync function, awaited at the top level withoutasyncio.run() - Pause with
setTimeout(), imported assleep()fromnode:timers/promises, in milliseconds - Recognize the promise an async call returns and await its value
- Await steps one at a time inside a
for...ofloop - Wait for several promises at once with
Promise.all() - Keep every outcome with
Promise.allSettled() - Stop waiting for slow work with
Promise.race() - Retry a failing call with
try/catcharoundawait - Keep a promise you await later from stopping the program