Stream.closeAsync() Overload 1

DESCRIPTION

Close the write direction of the stream asynchronously.

This will make the other end reach end of file when reading from a stream when all sent data has been received and acknowledged. A call to close does not affect the read direction of the stream.

DECLARATION

    public func closeAsync(closure: @escaping AsyncStatusReceiver) 

PARAMETERS

closure:
Invoked when the operation completes, see synchronous close() for possible errors.

Overload 2

DESCRIPTION

Close the write direction of the stream asynchronously.

This will make the other end reach end of file when reading from a stream when all sent data has been received and acknowledged. A call to close does not affect the read direction of the stream.

DECLARATION

    public func closeAsync() async throws 

THROWS ERRORS

ABORTED:
if the stream is closed
OPERATION_IN_PROGRESS:
if a stream write is in progress