orientechnologies / OrientDB.Net.Core

Experimental Modular OrientDB .Net Core Driver.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Async Queries

DavidParks8 opened this issue · comments

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

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

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?

I definitely open to help and would welcome it.

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