apache / apache/iotdb-client-csharp

Why doesn’t SessionDataSet implement the IAsyncDisposable interface?

Open
#54 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
24
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Currently, SessionDataSet implements the IDisposable interface. However, in its Dispose() method, the asynchronous Close() method is invoked synchronously.

Actual implementation:
```csharp
protected virtual void Dispose(bool disposing)
{
if (this.disposedValue)
return;
if (disposing)
{
try
{
//synchronous call
this.Close().Wait();
}
catch
{
}
}
this.disposedValue = true;
}
```

Proposed implementation:
```csharp
protected virtual Task DisposeAsync(bool disposing)
{
if (this.disposedValue)
return;
if (disposing)
{
try
{
//asynchronous call
await this.Close();
}
catch
{
}
}
this.disposedValue = true;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.