-
Notifications
You must be signed in to change notification settings - Fork 16
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
service: Add generic create_session(s) API #426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with a few queries and relatively minor points. Since I'm out early this week, I don't want to hold anything up so feel free to bypass me. Maybe @pbirkhol-ni should take a quick look before submitting.
This reverts commit 3d43db7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I didn't see any functional discrepancies between LabVIEW and python, although the implementation itself is radically different. :)
What does this Pull Request accomplish?
Add the generic create_session(s) API and some of the infrastructure needed for the driver-specific APIs.
session_management:
TSession
andTSession_co
type variablessession: object = None
toSessionInformation
to allow returning a session object along with the session infoTypedSessionInformation[TSession_co]
protocol to allow returning session objects in a type-safe mannerSessionInformation
class becauseTSession_co
is narrower thanobject
, so a cast is needed.create_session
andcreate_sessions
methods.@contextlib.contextmanager
from documentation and hover help_drivers:
closing_session
function to use to create a context manager to close the session_drivers._grpcdevice:
get_insecure_grpc_device_channel
functionWhy should this Pull Request be merged?
Part of the new session management API.
What testing has been done?
Ran mypy and tests.