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

DOCS-1069: Document API methods for Session and SessionManager #1752

Closed

Conversation

sguequierre
Copy link
Collaborator

@sguequierre sguequierre commented Sep 5, 2023

  • Add documentation for methods available and documented in RDK client docs

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Sep 5, 2023
@sguequierre sguequierre marked this pull request as ready for review September 11, 2023 15:20
@@ -8,7 +8,8 @@ tags: ["client", "sdk", "viam-server", "networking", "apis", "robot api", "sessi
---

When controlling a robot or fleet with Viam, you want a way to understand the presence of the clients that are communicating with and authenticated to each robot's `viam-server`.
The period of time during which these clients are present is called a *session*.
The period of time during which these clients are present is called a *session.*
Sessions each have [their own API](/program/apis/session), which is a client of `viam-server`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs technical review but I believe this is where the diagram can come in

@sguequierre sguequierre changed the title DOCS-1069: Document API methods for sessions DOCS-1069: Document API methods for Session and SessionManager Sep 11, 2023

## API

The `SessionManager` API built-in to the [Robot API](/program/apis/robot/) supports the following methods:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs documentation on NewSessionManager() in robot API to be functional-- sme review may help clear up some confusion on my end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, then removed,NewSessionManager() instantiation of mySessionManager-- unsure whether that should be in there or not. How would a user most simply request to the default session manager API with what we have set up in the RDK? @dgottlieb

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, this SessionManager structure is used by the viam-server running on a robot to track and time out/call Stop robot parts when heartbeats stop coming in.

Client code using the Go SDK wouldn't see anything happen if they were to try using this object.

That said, the documentation for these methods is 100% correct!

@viambot
Copy link
Member

viambot commented Sep 11, 2023

You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/dadae246166ac7c7f4dafac771d4d130de978c24/public


## API

The `Session` API supports the following methods:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question for @dgottlieb or any SME who has a better idea of what's going on in the RDK than I do: is this correct? Or should this all be replaced with https://pkg.go.dev/go.viam.com/[email protected]/session#Session as these are just the methods the session package offers and the interface for the type itself has different methods (Active, Heartbeat, etc.). Should both be on here? Apologies for the confusion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, for posterity, these are internal data types that are not client facing.

@sguequierre
Copy link
Collaborator Author

Closing out and leaving these methods undocumented as they are not meant to be user-facing re discussion with @dgottlieb @npentrel

Copy link
Member

@dgottlieb dgottlieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the following is the (internal) client* session/heartbeat code that gets run when connecting with sessions enabled:


## API

The `SessionManager` API built-in to the [Robot API](/program/apis/robot/) supports the following methods:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, this SessionManager structure is used by the viam-server running on a robot to track and time out/call Stop robot parts when heartbeats stop coming in.

Client code using the Go SDK wouldn't see anything happen if they were to try using this object.

That said, the documentation for these methods is 100% correct!


## API

The `Session` API supports the following methods:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, for posterity, these are internal data types that are not client facing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to build This pull request is marked safe to build from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants