ResInsight/GrpcInterface/RiaGrpcApplicationInterface.h
Kristian Bendiksen c2b5ab8d2c
#9307 Python: avoid assigning same port number to multiple grpc sessions
* Python: avoid assigning same port number to multiple grpc sessions
* Add retry count when checking for port number file
* Use grpc to find and use port number
* Add test used to start several instances of resinsight at the same time
Testing up to 50 instances works well

* Python: allow launch_port == 0 to assign port by GRPC in Instance.launch().
Also allow longer wait before failing the port number file reading:
it can take some time to launch when launching lots of instances at
the same time.
2022-09-26 14:19:21 +02:00

46 lines
1.3 KiB
C++

////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaGrpcServer.h"
#include <memory>
namespace cvf
{
class ProgramOptions;
}
class QProcessEnvironment;
class RiaGrpcApplicationInterface
{
public:
bool initializeGrpcServer( const cvf::ProgramOptions& progOpt );
void launchGrpcServer();
RiaGrpcServer* grpcServer() const;
QProcessEnvironment grpcProcessEnvironment() const;
int processRequests();
int portNumber() const;
protected:
std::unique_ptr<RiaGrpcServer> m_grpcServer;
};