apache / apache/iotdb-client-csharp

Why doesn’t SessionDataSet implement the IAsyncDisposable interface?

Offen
#54 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
24
Forks
6
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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;
}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.