Enforce emission of QGrpcOperation::finished
We've given the promise that the QGrpcOperation::finished signal is
emitted once during the lifetime of an RPC at multiple places!
That implies also the start of the RPC, but as of now this wasn't true.
The QGrpcClientBase fails a RPC under some conditions. We move this
logic to the QGrpcOperation class now.
This patch guarantees that the construction of RPC handlers is
successfull and that the finished signal is emitted in the error case.
In QGrpcOperation we remove the atomic isFinished flag. We replace it
with a more descriptive State, to handle the additional 'Invalid' state.
No multithreading is happening in the finished signal emission, so
atomic properties are not needed.
The 'serializeInitialMessage' is a preemptive move for the upcoming
interceptors logic, which will require such centralized handler.
[ChangeLog][Important Behavior Changes][QGrpcClientBase/QGrpcOperation]
RPC-handlers are now guaranteed to be constructed. The finished signal
will now be invoked at least once during the lifetime, as documented.
Change-Id: I83bcbcefa1f5533401c71260608327fe621324e2
Reviewed-by: Alexey Edelev <semlanik@gmail.com>