Other: Event Stream refactor.

Other: GRPCClient keeps track of the event stream status. [skip-ci]
Other: renamed StartEventStream to RunEventStream for clarity. [skip-ci]
This commit is contained in:
Xavier Michelon
2022-08-22 15:46:54 +02:00
committed by Jakub
parent 35d2cc9be7
commit 275a92ae93
13 changed files with 152 additions and 127 deletions

View File

@ -46,7 +46,7 @@ void EventStreamReader::run()
{
emit started();
grpc::Status const status = app().grpc().startEventStream();
grpc::Status const status = app().grpc().runEventStreamReader();
if (!status.ok())
throw Exception(QString::fromStdString(status.error_message()));

View File

@ -285,7 +285,7 @@ int main(int argc, char *argv[])
result = QGuiApplication::exec();
QObject::disconnect(connection);
app().grpc().stopEventStream();
app().grpc().stopEventStreamReader();
if (!app().backend().waitForEventStreamReaderToFinish(5000))
log.warn("Event stream reader took too long to finish.");