Skip to content

Commit 5cac710

Browse files
committed
make client IDisposable
1 parent 4c30170 commit 5cac710

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/SciSharp.MySQL.Replication/ReplicationClient.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace SciSharp.MySQL.Replication
1818
/// A client that implements MySQL replication protocol to act as a replica.
1919
/// This allows reading binary log events from a MySQL server in real-time.
2020
/// </summary>
21-
public class ReplicationClient : EasyClient<LogEvent>, IReplicationClient
21+
public class ReplicationClient : EasyClient<LogEvent>, IReplicationClient, IAsyncDisposable, IDisposable
2222
{
2323
private const byte CMD_DUMP_BINLOG = 0x12;
2424

@@ -495,5 +495,17 @@ public override async ValueTask CloseAsync()
495495

496496
await base.CloseAsync().ConfigureAwait(false);
497497
}
498+
499+
/// <inheritdoc/>
500+
public async ValueTask DisposeAsync()
501+
{
502+
await CloseAsync();
503+
}
504+
505+
/// <inheritdoc/>
506+
public void Dispose()
507+
{
508+
CloseAsync().AsTask().Wait();
509+
}
498510
}
499511
}

0 commit comments

Comments
 (0)