@@ -17,7 +17,7 @@ namespace Npgsql
1717 /// <remarks>
1818 /// See https://www.postgresql.org/docs/current/static/sql-copy.html.
1919 /// </remarks>
20- public sealed class NpgsqlBinaryImporter : ICancelable , IAsyncDisposable
20+ public sealed class NpgsqlBinaryImporter : ICancelable
2121 {
2222 #region Fields and Properties
2323
@@ -480,15 +480,28 @@ async ValueTask<ulong> Complete(bool async, CancellationToken cancellationToken
480480
481481 void ICancelable . Cancel ( ) => Close ( ) ;
482482
483+ async Task ICancelable . CancelAsync ( ) => await CloseAsync ( ) ;
484+
483485 /// <summary>
484- /// Cancels that binary import and sets the connection back to idle state
486+ /// <para>
487+ /// Terminates the ongoing binary import and puts the connection back into the idle state, where regular commands can be executed.
488+ /// </para>
489+ /// <para>
490+ /// Note that if <see cref="Complete()" /> hasn't been invoked before calling this, the import will be cancelled and all changes will
491+ /// be reverted.
492+ /// </para>
485493 /// </summary>
486494 public void Dispose ( ) => Close ( ) ;
487495
488496 /// <summary>
489- /// Async cancels that binary import and sets the connection back to idle state
497+ /// <para>
498+ /// Async terminates the ongoing binary import and puts the connection back into the idle state, where regular commands can be executed.
499+ /// </para>
500+ /// <para>
501+ /// Note that if <see cref="CompleteAsync" /> hasn't been invoked before calling this, the import will be cancelled and all changes will
502+ /// be reverted.
503+ /// </para>
490504 /// </summary>
491- /// <returns></returns>
492505 public ValueTask DisposeAsync ( )
493506 {
494507 using ( NoSynchronizationContextScope . Enter ( ) )
@@ -518,15 +531,25 @@ async Task Cancel(bool async, CancellationToken cancellationToken = default)
518531 }
519532
520533 /// <summary>
521- /// Completes the import process and signals to the database to write everything.
534+ /// <para>
535+ /// Terminates the ongoing binary import and puts the connection back into the idle state, where regular commands can be executed.
536+ /// </para>
537+ /// <para>
538+ /// Note that if <see cref="Complete()" /> hasn't been invoked before calling this, the import will be cancelled and all changes will
539+ /// be reverted.
540+ /// </para>
522541 /// </summary>
523542 public void Close ( ) => CloseAsync ( false ) . GetAwaiter ( ) . GetResult ( ) ;
524543
525544 /// <summary>
526- /// Async completes the import process and signals to the database to write everything.
545+ /// <para>
546+ /// Async terminates the ongoing binary import and puts the connection back into the idle state, where regular commands can be executed.
547+ /// </para>
548+ /// <para>
549+ /// Note that if <see cref="CompleteAsync" /> hasn't been invoked before calling this, the import will be cancelled and all changes will
550+ /// be reverted.
551+ /// </para>
527552 /// </summary>
528- /// <returns></returns>
529- /// <exception cref="Exception"></exception>
530553 public ValueTask CloseAsync ( CancellationToken cancellationToken = default )
531554 {
532555 if ( cancellationToken . IsCancellationRequested )
0 commit comments