Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Sources/NIOPosix/PendingDatagramWritesManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,16 @@ final class PendingDatagramWritesManager: PendingWritesManager {
}
}

/// Fail all the outstanding writes. This is useful if for example the `Channel` is closed.
func failAll(error: Error, close: Bool) {
if close {
assert(self.isOpen)
self.isOpen = false
}
/// Close the write manager and fail all the outstanding writes. This is useful if for example the `Channel` is closed.
func closeAndFailAll(error: Error) {
assert(self.isOpen)
self.isOpen = false

self.failAll(error: error)
}

/// Fail all the outstanding writes. This is useful if for example the `Channel` is closed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be useful to clean up these doc comments and explain where we might do one and the other.

func failAll(error: Error) {
self.state.failAll(error: error)

assert(self.state.isEmpty)
Expand Down
Loading