Concurrent Thread Plugin level vs device level.
Posted: Sun Nov 19, 2017 1:47 pm
Forgive my lack of general programming knowledge here. Maybe this answer is obvious, but it appears I need a bit of handholding...
So I've made a few plugins, all of a similar style. Serial-port interfaces where the plugin itself connects to another system via serial port, and then controls multiple devices through that, and the runConcurrentThread process can parse off responses into the correct state changes for each device, etc...
But can someone describe to me (in caveman terms here) how this works when the kind of 'Concurrent Thread' process is more Device-specific? i.e. if it was some sort of serial communications plugin, I'm thinking of where each 'device' has its OWN serial connection, so it's not all going through one main one, and that connection is defined at the device level. There's no 'runDeviceConcurrentThread' is there?
I'm thinking that I make one? (and then the main, runConcurrentThread isn't a loop, to do anything so much as a loop to just start the deviceConcurrentThread for each device that exits and is enabled? (and then I guess stopConcurrentThread maybe just passes a kill variable to each deviceConcurrentThread?) Or is there some simpler, more obvious way here?
(I know people have built plugins like this before, and I'm trying to go through them and look, but these answers aren't super-obvious to me).
Any help is appreciated.
So I've made a few plugins, all of a similar style. Serial-port interfaces where the plugin itself connects to another system via serial port, and then controls multiple devices through that, and the runConcurrentThread process can parse off responses into the correct state changes for each device, etc...
But can someone describe to me (in caveman terms here) how this works when the kind of 'Concurrent Thread' process is more Device-specific? i.e. if it was some sort of serial communications plugin, I'm thinking of where each 'device' has its OWN serial connection, so it's not all going through one main one, and that connection is defined at the device level. There's no 'runDeviceConcurrentThread' is there?
I'm thinking that I make one? (and then the main, runConcurrentThread isn't a loop, to do anything so much as a loop to just start the deviceConcurrentThread for each device that exits and is enabled? (and then I guess stopConcurrentThread maybe just passes a kill variable to each deviceConcurrentThread?) Or is there some simpler, more obvious way here?
(I know people have built plugins like this before, and I'm trying to go through them and look, but these answers aren't super-obvious to me).
Any help is appreciated.