You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by jorgebay <gi...@git.apache.org> on 2018/09/03 07:51:47 UTC

[GitHub] tinkerpop issue #903: Gremlin.Net: Add ConnectionPool min and max sizes TINK...

Github user jorgebay commented on the issue:

    https://github.com/apache/tinkerpop/pull/903
  
    Its one send at a time, that means that we have to send it one at a time but not necessary awaiting to receive after each send.
    
    ```c#
    // Send in a loop until the queue is exhausted
    while (writeQueue.TryDequeue(out var item))
    {
        await ws.SendAsync(item);
    }
    ```
    
    ```c#
    // Always have an outstanding receiveasync call
    // We should not await on the ReceiveAsync()
    ws.ReceiveAsync().ContinueWith(
      item => 
      {
        ParseItem(item);
        ReceiveNext();
      }
      , ExecuteSynchronously);
    ```


---