2 From mental model to skeleton code
This chapter covers
- Creating skeletons for task, worker, manager, and scheduler components
- Identifying the states of a task
- Using an interface to support different types of schedulers
- Writing a test program to verify that the code will compile and run
Once I have a mental model for a project, I like to translate that model into skeleton code. I do this quite frequently in my day job. It’s similar to how carpenters frame a house: they define the exterior walls and interior rooms with two-by-fours and add trusses to give the roof a shape. This frame isn’t the finished product, but it marks the boundaries of the structure, allowing others to come along and add details later in the construction.
In the same ...
Get Build an Orchestrator in Go (From Scratch) now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.