Open jlouis opened 8 years ago
I think a FSM is a better approach here:
┌─────────┐
│ │
│ waiting │───put────┬─────────────┐
│ │ │ │
└─────────┘ │ │
▲ │ │
│ │ │
│ ▼ ▼
│ ┌─────────┐ ┌─────────┐
│ │ │ │ │
│ │positive │ │negative │
│ │ │ │ │
│ └─────────┘ └─────────┘
│ │ │
│ │ │
└───────────────┴──get────────┘
I think if we are to do this, we should build a project which uses this as a dependency. There is no reason to bind the things into one big system when you can decouple them into two modules. The same is true with #4 which ought to be yet.
You are are absolutely right, in that sense positive should only have a single function.
The subject says it all.