iterativ / openopc2

🔥 OPC DA Python Library with awesome CLI
Other
92 stars 12 forks source link

Improvement: OPC server statefulness in OpcDaClient #43

Open jamesbraza opened 1 year ago

jamesbraza commented 1 year ago

In openopc2.da_client.OpcDaClient, there is some awkward statefulness:

open_opc_config = OpenOpcConfig()
open_opc_config.OPC_SERVER = opc_server  # Pretend no env vars for now
opc_client = OpcDaClient(open_opc_config=open_opc_config)
opc_client.connect(opc_server=opc_server)

The statefulness comes from:

Just pointing out this is awkward, and to me indicates room for a better design.

renzop commented 1 year ago

True.