The internal work queue is converted into a "deque" which supports adding items at start and end of queue.
CreateChannel commands are automatically always added to the start of the work queue
Benefits:
In case of connection failover (due to connection loss or not leader) the number of failing operations will be reduced.
Drawbacks:
Issued Shutdown commands will be delayed, i.e. even if the client has been shutdown a reconnect is performed.
Example: client executes an operation, receives an exception that operation failed to connection loss, client code wants to shutdown the client => shutdown will be executed after performing the reconnect attempts (which might take some time).
I will retract this PR as discussed internally and we will look for a more robust solution regarding a imrpoved connect/reconnect strategy for the GrpcClient.
Improvement for https://github.com/EventStore/EventStoreDB-Client-Java/issues/170
Implementation approach:
CreateChannel
commands are automatically always added to the start of the work queueBenefits:
Drawbacks:
Shutdown
commands will be delayed, i.e. even if the client has been shutdown a reconnect is performed. Example: client executes an operation, receives an exception that operation failed to connection loss, client code wants to shutdown the client => shutdown will be executed after performing the reconnect attempts (which might take some time).