mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-03 20:20:48 -06:00
#4418 Handle all queued gRPC requests per main loop iteration
* This means a streaming request should be completed in one main loop iteration
This commit is contained in:
parent
4aad1e61d1
commit
b44f0a2029
@ -1681,7 +1681,7 @@ void RiaGuiApplication::runIdleProcessing()
|
||||
#ifdef ENABLE_GRPC
|
||||
if (!caf::ProgressInfoStatic::isRunning())
|
||||
{
|
||||
m_grpcServer->processOneRequest();
|
||||
m_grpcServer->processRequests();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
#include <grpc/support/log.h>
|
||||
#include <grpcpp/grpcpp.h>
|
||||
@ -60,7 +61,7 @@ public:
|
||||
void run();
|
||||
void runInThread();
|
||||
void initialize();
|
||||
void processOneRequest();
|
||||
void processRequests();
|
||||
void quit();
|
||||
int currentPortNumber;
|
||||
|
||||
@ -168,10 +169,11 @@ void RiaGrpcServerImpl::initialize()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGrpcServerImpl::processOneRequest()
|
||||
void RiaGrpcServerImpl::processRequests()
|
||||
{
|
||||
std::lock_guard<std::mutex> requestLock(m_requestMutex);
|
||||
if (!m_unprocessedRequests.empty())
|
||||
|
||||
while (!m_unprocessedRequests.empty())
|
||||
{
|
||||
RiaAbstractGrpcCallback* method = m_unprocessedRequests.front();
|
||||
m_unprocessedRequests.pop_front();
|
||||
@ -325,9 +327,9 @@ void RiaGrpcServer::initialize()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGrpcServer::processOneRequest()
|
||||
void RiaGrpcServer::processRequests()
|
||||
{
|
||||
m_serverImpl->processOneRequest();
|
||||
m_serverImpl->processRequests();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
bool isRunning() const;
|
||||
void run();
|
||||
void runInThread();
|
||||
void processOneRequest();
|
||||
void processRequests();
|
||||
void quit();
|
||||
static int findAvailablePortNumber(int defaultPortNumber);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user