AdvancedClimateSystems / uModbus

Python implementation of the Modbus protocol.
Mozilla Public License 2.0
211 stars 82 forks source link

Async tcp server #67

Closed bradder555 closed 5 years ago

bradder555 commented 5 years ago

a blocking server is handy if there is a background thread mutating memory, or if we are only interested in mutating this memory through modbus

to expand the functionality a little bit, an async option has been added, this fires up the server on a background thread freeing up the forground (or alternative thread) to modify the block of memory.

this is nice, because the application can now be used to simulate a plc or rio in one process

currently this pattern only works with the TcpSocket server, it would be nice to expand this further to provide the same interface for the serial class

also adds an example for use to the readme

in the future it may be a good idea to consider a lock on the datastore, since this uses threads now

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.9%) to 95.364% when pulling f4622f3e91df765eb8424d3988b1a294b2bcd6fa on bradder555:async_tcp_server into 0560a42308003f4072d988f28042b8d55b694ad4 on AdvancedClimateSystems:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.9%) to 95.364% when pulling f4622f3e91df765eb8424d3988b1a294b2bcd6fa on bradder555:async_tcp_server into 0560a42308003f4072d988f28042b8d55b694ad4 on AdvancedClimateSystems:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.9%) to 95.364% when pulling f4622f3e91df765eb8424d3988b1a294b2bcd6fa on bradder555:async_tcp_server into 0560a42308003f4072d988f28042b8d55b694ad4 on AdvancedClimateSystems:master.