pymodbus icon indicating copy to clipboard operation
pymodbus copied to clipboard

move transaction handling into framer socket.

Open janiversen opened this issue 1 year ago • 3 comments

Transactions at device level is only supported by the socket framer, therefore it is logical to remove the general transaction handling, and make a specific transaction handling directly in the framer.

Seen from the APP POW, the library offers a request/response API, meaning there are never more than 1 transaction outstanding, so need for a app level transaction handling.

The request/response API is partly not protected by a lock, making it difficult for multitask application to secure serialization.

  • for sync clients, no further lock is needed (apps using threads and sync calls, need to manage this themself)
  • for async clients an asyncio.lock needs to be added to all calls (centrally in the execute), important the lock needs to be reset in case of exceptions.

This should only be implemented in the new framers, and the old_framers kept unchanged.

janiversen avatar Jul 22 '24 10:07 janiversen

Correction the server still needs to know the transaction id, but since the server handles the requests one by one. the socket framer can keep the tid from the request and automatically add it to the response.

janiversen avatar Jul 23 '24 11:07 janiversen

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 23 '24 02:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Aug 28 '24 02:08 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 28 '24 02:09 github-actions[bot]

It will be done differently, in the new transaction layer.

janiversen avatar Oct 16 '24 12:10 janiversen