cancel
fun cancel()
Content copied to clipboard
Fail any in-flight and future operations. After canceling:
Any attempt to write or flush sink will fail immediately with an IOException.
Any attempt to read source will fail immediately with an IOException.
Any attempt to fold will fail immediately with an IOException.
Closing the source and the sink will complete normally even after a pipe has been canceled. If this sink has been folded, closing it will close the folded sink. This operation may block.
This operation may be called by any thread at any time. It is safe to call concurrently while operating on the source or the sink.