Add optional readiness checks to memory TcpClient#1134
Merged
Conversation
This commit introduces a new internal transaction type, TcpBridgeProbe, to facilitate readiness probing in the TcpClient and TcpServer classes. The TcpClient now includes a waitReady method that verifies the request/response path is operational before proceeding. Additionally, the constructor of TcpClient has been updated to accept a waitReady parameter, allowing for optional blocking during startup. The TcpServer has been modified to handle the TcpBridgeProbe locally, ensuring proper acknowledgment of readiness. Tests have been updated to reflect these changes.
This commit introduces a new start method in the TcpServer class, which serves as a managed-lifecycle startup hook. Although the server binds and starts its worker thread in the constructor, this method allows TcpServer to participate uniformly in PyRogue's managed interface lifecycle handling. The setup_python function has been updated to expose this new method to Python.
… return values; remove unnecessary blank lines in test files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pre-release #1134 +/- ##
===============================================
+ Coverage 29.54% 29.59% +0.04%
===============================================
Files 65 68 +3
Lines 6644 6944 +300
Branches 1015 969 -46
===============================================
+ Hits 1963 2055 +92
- Misses 4527 4736 +209
+ Partials 154 153 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ruck314
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This branch adds an explicit readiness-check capability to
rogue.interfaces.memory.TcpClientand updates a few timing-sensitive tests to use it.The main change is a lightweight built-in bridge probe between
memory.TcpClientandmemory.TcpServer. This allows a client to verify that the TCP memory request/response path is actually usable, rather than relying on fixed sleeps or local socket-connect assumptions.What changed:
rim::TcpBridgeProbememory.TcpServerto recognize and answer that probe locallymemory.TcpClient.waitReady(timeout, period)waitReadyas an optionalTcpClientconstructor flagTcpClient(addr, port, waitReady=False)waitReady=True, managed_start()blocks on bridge readinesswaitReadyis not enabled, startup behavior is unchangedTests updated:
tests/test_enum.pytests/test_epics.pyThese now use
TcpClient(..., waitReady=True)instead of fixed startup sleeps or external readiness wrappers.Docs updated:
docs/src/pyrogue_tree/node/device/index.rstImportant compatibility note:
TcpServeris only affected if the new readiness probe is explicitly enabledThis branch also includes a short-lived exploration of broader managed interface readiness, but the final implementation intentionally keeps the scope focused on
TcpClientreadiness rather than introducing a new generic PyRogue wrapper mechanism.