Exemple #1
0
    def delete_session(self, session_id: int) -> core_pb2.DeleteSessionResponse:
        """
        Delete a session.

        :param session_id: id of session
        :return: response with result of deletion success or failure
        :raises grpc.RpcError: when session doesn't exist
        """
        request = core_pb2.DeleteSessionRequest(session_id=session_id)
        return self.stub.DeleteSession(request)
Exemple #2
0
    def delete_session(self, session_id: int) -> bool:
        """
        Delete a session.

        :param session_id: id of session
        :return: True for success, False otherwise
        :raises grpc.RpcError: when session doesn't exist
        """
        request = core_pb2.DeleteSessionRequest(session_id=session_id)
        response = self.stub.DeleteSession(request)
        return response.result