tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jorgebay <...@git.apache.org>
Subject [GitHub] tinkerpop issue #903: Gremlin.Net: Add ConnectionPool min and max sizes TINK...
Date Mon, 03 Sep 2018 07:51:47 GMT
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);
    ```


---

Mime
View raw message