[ 
https://issues.apache.org/jira/browse/TINKERPOP-1775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16647922#comment-16647922
 ] 

Florian Hockmann commented on TINKERPOP-1775:
---------------------------------------------

[~jorgebg] and I already had a discussion about how this ticket could be 
implemented [in the PR for|https://github.com/apache/tinkerpop/pull/903] 
TINKERPOP-1774 and we came to the conclusion that it's probably best to 
implement both tickets together. Here are the key points from the discussion 
that outline how this ticket could be implemented:
 * {{Connection}}:
 ** Gets its own write queue
 ** New requests are simply appended to this queue.
 ** Sends messages from its queue as fast as possible, one {{SendAsync()}} 
after another
 ** Maintains a lookup table: {{requestId}} --> response callback
 ** Continuously awaits {{ReceiveAsync()}} and invokes the right callback for 
every received response based on the {{requestId}}
 * {{ConnectionPool}}:
 ** Keeps all created Connections in its pool (they aren't taken out of the 
pool completely while in use any more)
 ** Either returns a random {{Connection}} or returns the least-used 
{{Connection}} based on an in-flight counter on the {{Connection}} (the latter 
would be the better solution but is a bit more complex).
         -> round-robin with a modulo counter
 ** Uses a max in-flight threshold to decide when more connections should be 
created.
 ** Has a max amount connections limit, when reached: Throttle requests by 
throwing an exception.

> Gremlin .NET: Implement a Connection write queue to support request pipelining
> ------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1775
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1775
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet
>    Affects Versions: 3.2.7
>            Reporter: Jorge Bay
>            Priority: Minor
>
> We should create a write queue to process and write each request in FIFO 
> fashion, without awaiting for each response individually.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to