M
ManicQin
Hi,
I hope that the subject is not too obfuscated.
Small back ground: In my system I manage many devices each device is
responsible for his own
communication queue.
A thread iterates over all the devices and tries to send one msg from
each device.
Sometimes msgs cannot be sent for obvious reasons (comm lost and etc)
and you need to handle the failure in a right fashion. (stop
processes, Alert problems and etc)
Right now my predecessor thought that it is good and nice design to
add a huge switch case that
if device is x and the operation is y (when Y is a global flag) do z
all this in the Comm::send function...
And I cant change this code because... maybe it's buggy maybe it's
error prone but it works...
So I just wondered (for shi*s and giggles), what other solutions to
this atrocity can you offer
I my self thought of just attaching a callbacks for success\ failure
for each msg...
any other suggestions?
thanks
I hope that the subject is not too obfuscated.
Small back ground: In my system I manage many devices each device is
responsible for his own
communication queue.
A thread iterates over all the devices and tries to send one msg from
each device.
Sometimes msgs cannot be sent for obvious reasons (comm lost and etc)
and you need to handle the failure in a right fashion. (stop
processes, Alert problems and etc)
Right now my predecessor thought that it is good and nice design to
add a huge switch case that
if device is x and the operation is y (when Y is a global flag) do z
all this in the Comm::send function...
And I cant change this code because... maybe it's buggy maybe it's
error prone but it works...
So I just wondered (for shi*s and giggles), what other solutions to
this atrocity can you offer
I my self thought of just attaching a callbacks for success\ failure
for each msg...
any other suggestions?
thanks