orientechnologies / OrientDB.Net.Core

Experimental Modular OrientDB .Net Core Driver.
16 stars 8 forks source link

Feature Request: Async Queries #6

Closed DavidParks8 closed 7 years ago

DavidParks8 commented 7 years ago

I would like to have support for async queries (using async and await with tasks).

realityenigma commented 7 years ago

I will investigate adding support. Thank you for the recommendation!

alzuma commented 7 years ago

this is doable, it all starts in "OrientDBBinaryConnectionStream.cs"

private void Send(byte[] buffer, NetworkStream stream)
{
    if ((stream != null) && stream.CanWrite)
    {
        try
        {
            stream.Write(buffer, 0, buffer.Length);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message, ex.InnerException);
        }
    }
}

add async one

private async Task SendAsync(byte[] buffer, NetworkStream stream)
{
    if (stream != null && stream.CanWrite)
    {
        await stream.WriteAsync(buffer, 0, buffer.Length);
    }
}

and then few more places up the stream.

Need help with this?

realityenigma commented 7 years ago

I definitely open to help and would welcome it.

gar-ema commented 7 years ago

This issue was moved to orientechnologies/OrientDB.Net#12