Skip to content

Commit

Permalink
Rename onRequestCompleted to onConnectionIdle
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadoba committed Jan 25, 2023
1 parent efa86b5 commit 5f5dc1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ final class HTTP1ClientChannelHandler: ChannelDuplexHandler {
private let eventLoop: EventLoop
private let connectionIdLoggerMetadata: Logger.MetadataValue

var onRequestCompleted: () -> Void = {}
var onConnectionIdle: () -> Void = {}
init(eventLoop: EventLoop, backgroundLogger: Logger, connectionIdLoggerMetadata: Logger.MetadataValue) {
self.eventLoop = eventLoop
self.backgroundLogger = backgroundLogger
Expand Down Expand Up @@ -275,7 +275,7 @@ final class HTTP1ClientChannelHandler: ChannelDuplexHandler {
if shouldClose {
context.close(promise: nil)
} else {
self.onRequestCompleted()
self.onConnectionIdle()
}

oldRequest.succeedRequest(buffer)
Expand All @@ -287,7 +287,7 @@ final class HTTP1ClientChannelHandler: ChannelDuplexHandler {

context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: writePromise)
case .informConnectionIsIdle:
self.onRequestCompleted()
self.onConnectionIdle()
oldRequest.succeedRequest(buffer)
}

Expand All @@ -304,7 +304,7 @@ final class HTTP1ClientChannelHandler: ChannelDuplexHandler {
oldRequest.fail(error)

case .informConnectionIsIdle:
self.onRequestCompleted()
self.onConnectionIdle()
oldRequest.fail(error)

case .failWritePromise(let writePromise):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ final class HTTP1Connection {
backgroundLogger: logger,
connectionIdLoggerMetadata: "\(self.id)"
)
channelHandler.onRequestCompleted = {
channelHandler.onConnectionIdle = {
self.taskCompleted()
}

Expand Down

0 comments on commit 5f5dc1e

Please sign in to comment.