Fail if devices request mixed green modes in single device server
Device's allow the green_mode
attribute to be set to options such as GreenMode.Asyncio
and GreenMode.Gevent
to allow asynchronous behaviour. It can also be set to GreenMode.Synchronous
for synchronous behaviour, which is the default. If the attribute is not set, PyTango uses the global green mode at the time the server is started. The default for the global mode is GreenMode.Synchronous
.
A Device Server process can run multiple Devices. What happens if two Devices with different green_mode
attribute values are run? PyTango cannot do both, so it should fail at startup by raising an exception.
The server.run
method has an optional green_mode
argument. This argument, combined with the green_mode
attributes in the Devices provide multiple ways to specify the mode. It should be an error if the specified and default values do not agree.
Fix/update MultiDeviceTestContext
. It has a check, but this doesn't cover the case where some devices have no green_mode
specified (so they should be synchronous), and other devices have their green_mode
set to GreenMode.Asyncio
. Possibly this check can be removed, if the fix to the server.run
check is sufficient.