grpc: updated create session to return a session object with default values, avoids scripts needing to create and then join, can just create and leverage the returned object
This commit is contained in:
parent
598cb0f10d
commit
53ae6ac784
12 changed files with 136 additions and 87 deletions
|
@ -343,11 +343,7 @@ class CoreGrpcClient:
|
|||
response = self.stub.StopSession(request)
|
||||
return response.result
|
||||
|
||||
def add_session(self, session_id: int = None) -> wrappers.Session:
|
||||
session_id = self.create_session(session_id)
|
||||
return self.get_session(session_id)
|
||||
|
||||
def create_session(self, session_id: int = None) -> int:
|
||||
def create_session(self, session_id: int = None) -> wrappers.Session:
|
||||
"""
|
||||
Create a session.
|
||||
|
||||
|
@ -357,7 +353,7 @@ class CoreGrpcClient:
|
|||
"""
|
||||
request = core_pb2.CreateSessionRequest(session_id=session_id)
|
||||
response = self.stub.CreateSession(request)
|
||||
return response.session_id
|
||||
return wrappers.Session.from_proto(response.session)
|
||||
|
||||
def delete_session(self, session_id: int) -> bool:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue