Make command methods async, keeping blocking wrapper for compat#32
Open
michaelosthege wants to merge 3 commits into
Open
Make command methods async, keeping blocking wrapper for compat#32michaelosthege wants to merge 3 commits into
michaelosthege wants to merge 3 commits into
Conversation
7da8ef5 to
8ecb8a5
Compare
michaelosthege
commented
May 23, 2026
Contributor
Author
michaelosthege
left a comment
There was a problem hiding this comment.
I have tested these and can confirm two robots moving at the same time, controlled from one Python application 😎
Comment on lines
+548
to
+550
| def list_files(self) -> bool: | ||
| """Blocking wrapper around :func:`CRIClient.list_files_async`.""" | ||
| return asyncio.get_event_loop().run_until_complete(self.list_files_async()) |
Contributor
Author
There was a problem hiding this comment.
Out of scope for this PR, but I noticed that list_files(self) -> bool is a very weird signature.
I'm not familiar with the command, but generally I find methods like list_files(self) -> list[str] much more useful.
The same applies to get_board_temperatures, get_motor_temperatures.
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.
This is a follow-up to #31.
Importantly, this fixes bugs with
wait_event_with_timeoutthat were introduced in #31:timeout=Nonenow waits for 24 hours 👈 I can not think of a scenario where any of the move methods should even wait that long (but they default totimeout=None). Users can always override with even longer timeouts if needed.I'd like to call all commands asynchronously so our application can do other stuff in parallel (such as commanding another Igus).
For backwards-compatibility and ease of use in other contexts I suppose the blocking methods should be kept.