Working as a software engineer in the field of electronics, I often find that none of the existing design patterns i.e. GoF typically fit the bill for what I need to do. One of the patterns that I frequently use works something like this:
- Open up a connection to some electronic device.
- Transmit a command to that electronic device, to make it perform some work.
- Block the thread until that electronic device does whatever it needs to do, and responds back saying that it (the device) finished.
- Unblock the thread once I receive the response from the device, and continue executing.
This pattern is typically used in scenarios where I need to talk to IEEE 488.2 SCPI devices like multi-meters. I typically write libraries that handle the commands/response from the devices in this manner. An example is where I might do something such as:
- Connect to the meter.
- Tell the meter to give me the voltage.
- Wait for the meter to respond back with the voltage, then unblock once it does so.
- Unblock, and process the received voltage (e.g. return it from some library
I would like to know what the formal name for doing this is. I've heard command-response but am not sure about that. I know it's not controller-pattern, and I also know that this isn't the command-pattern.
Is there a formal name for this kind of a design-pattern/system?