jorgebay commented on a change in pull request #1016: Add request pipelining
and a fixed ConnectionPool size TINKERPOP-1775 and TINKERPOP-1774
URL: https://github.com/apache/tinkerpop/pull/1016#discussion_r243538532
##########
File path: gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs
##########
@@ -154,6 +159,67 @@ private string SaslArgument()
return Convert.ToBase64String(authBytes);
}
+ private void BeginSendingMessages()
+ {
+ if (Interlocked.CompareExchange(ref _writeInProgress, 1, 0) != 0)
+ return;
+ SendNextMessageFromQueue();
+ Interlocked.CompareExchange(ref _writeInProgress, 0, 1);
+ }
+
+ private void SendNextMessageFromQueue()
Review comment:
Suggestion: to simplify the implementation you can create an async method:
```C#
private async Task SendNextMessageFromQueue() {}
```
And use `await` for your dequeue-send flow. If you catch your exceptions,
its safe to start the call for `SendNextMessageFromQueue()` as "fire and
forget". The end result will be the same (as `ContinueWith()` does exactly
that) but the code will be simpler.
You can look at a `Forget()` implementation here:
https://github.com/datastax/csharp-driver/blob/46e8da823512f12cc4f109e6812ff611a9f14e20/src/Cassandra/Tasks/TaskHelper.cs#L380-L387
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services