Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add actuating methods as a check #344

Merged
merged 3 commits into from
Mar 6, 2025

Conversation

njooma
Copy link
Member

@njooma njooma commented Feb 26, 2025

clone of viamrobotics/viam-python-sdk#857

Updated the functionality to now use reflection to determine if a method is monitored.

At the beginning of the session:

  1. Get the list of services on the connected machine
  2. For each service, get the list of methods
  3. For each method, store whether it is monitored in a map

Then, when making a call:

  1. Check to see if the method is monitored
  2. Add metadata if monitored

Had to do it this way because we can't use reflection prior to making a call because reflection is async, and creating a call is sync. So We have to basically create a list of monitored methods at the very start.

This also fixes a subtle bug in the session client where it could exit the heartbeat task early because getting the metadata is async, but we start the task synchronously

@njooma njooma requested a review from a team as a code owner February 26, 2025 17:32
@njooma njooma requested review from stuqdog and lia-viam February 26, 2025 17:32
@njooma njooma force-pushed the RSDK-9328/non-actuating-session branch from deaf37e to 0877408 Compare March 6, 2025 04:03
@njooma njooma requested a review from stuqdog March 6, 2025 04:08
@njooma njooma merged commit 6eb9f12 into viamrobotics:main Mar 6, 2025
4 checks passed
@njooma njooma deleted the RSDK-9328/non-actuating-session branch March 6, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants