Python’s with releases a resource only once acquiring it has succeeded, but a finally runs whenever its try started. Port the print shop’s with JobLock(job["id"]): to try/finally with the lock-taking call inside the try, and when another PC already holds job J-314’s lock, the finally deletes that PC’s lock. The run ends with no error.
In this course, you’ll port a print shop’s Python job runner, which locks each job, spools its artwork, sends it to a press, and cleans up even when a job fails, to JavaScript.
By the end of this course, you’ll be able to:
- Clean up with
try/finally, taking the resource on the line before thetry - Tell which
node:fscalls close the files they open, and which resources you must close yourself - Release a lock with
usingandSymbol.dispose, and turn a@contextmanagerfunction into one that returns a disposable - Close a connection with
await using, and collect a changing set of resources with anAsyncDisposableStack - Port the whole job runner to JavaScript
You’ll need Python’s context managers, including @contextmanager, async context managers, and ExitStack, plus Node 26 and the JavaScript for classes, async functions, try and catch, and reading and writing files. The Python examples use Python 3.15.
The course mixes short videos and text lessons with exercises, a project that ports the whole job runner, and a quiz.
What’s Included:
- 14 Lessons
- Video Subtitles and Full Transcripts
- Translated Subtitles in 8 Languages
- 2 Downloadable Resources
- Interactive Quiz to Check Your Progress
- 4 Hands-On Coding Exercises
- Q&A With JavaScript Experts: Ask a Question
- Certificate of Completion
Downloadable Resources:
Related Learning Paths: