Communicate the purpose by good naming

In its most basic form, the producer-consumer pattern uses one task for producing work items and another for consuming those items.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Producer โ”‚ โ†’ โ”‚ Work items โ”‚ โ†’ โ”‚ Consumer โ”‚ โ†’ ๐Ÿ’ฐ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

You can have multiple producers and consumers, too. Whatever makes sense in your project!

You decide on two task names:

  • Produce traffic data work items
  • Consume traffic data work items

Name tasks using business terms and vocabulary. Instead of just Produce or Consume, indicate what you produce and consume.

That was easy. On to the next chapter!

Actually, naming is one of the things that is quite hard to get right the first time. Spend some time figuring out proper names for all your things (folders, files, tasks, keywords, variables, classes, methods, functions, version control branches, workspaces, processes, pets, kids...).