Skip to content

Commit f53485c

Browse files
committed
Add public triggerForceShutdown to ConnectionPool
Add distinct method that we need in Valkey (valkey-io/valkey-swift/pulls/#85)
1 parent c7e2cda commit f53485c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Sources/ConnectionPoolModule/ConnectionPool.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,15 @@ public final class ConnectionPool<
283283
await self.run(in: &taskGroup)
284284
}
285285
} onCancel: {
286-
let actions = self.stateBox.withLockedValue { state in
287-
state.stateMachine.triggerForceShutdown()
288-
}
286+
self.triggerForceShutdown()
287+
}
288+
}
289289

290-
self.runStateMachineActions(actions)
290+
public func triggerForceShutdown() {
291+
let actions = self.stateBox.withLockedValue { state in
292+
state.stateMachine.triggerForceShutdown()
291293
}
294+
self.runStateMachineActions(actions)
292295
}
293296

294297
// MARK: - Private Methods -

0 commit comments

Comments
 (0)