flushAndClose

abstract fun flushAndClose(scope: CoroutineScope): Deferred<Unit>

挂起刷新缓冲区并关闭写入端。

完成后通道将处于“写关闭”状态,但读取端仍可继续接收数据(半关)。

Return

跟踪刷关任务的 Deferred

Parameters

scope

用于启动刷关任务的协程作用域