Skip to content

Commit 2a22156

Browse files
authored
Use assertInEventLoop over assert(el.inEventLoop) (#303)
1 parent 7ea9dd2 commit 2a22156

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/AsyncHTTPClient/ConnectionPool.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,19 @@ class Connection {
197197
///
198198
/// - Warning: This only releases the connection and doesn't take care of cleaning handlers in the `Channel` pipeline.
199199
func release(closing: Bool, logger: Logger) {
200-
assert(self.channel.eventLoop.inEventLoop)
200+
self.channel.eventLoop.assertInEventLoop()
201201
self.provider.release(connection: self, closing: closing, logger: logger)
202202
}
203203

204204
/// Called when channel exceeds idle time in pool.
205205
func timeout(logger: Logger) {
206-
assert(self.channel.eventLoop.inEventLoop)
206+
self.channel.eventLoop.assertInEventLoop()
207207
self.provider.timeout(connection: self, logger: logger)
208208
}
209209

210210
/// Called when channel goes inactive while in the pool.
211211
func remoteClosed(logger: Logger) {
212-
assert(self.channel.eventLoop.inEventLoop)
212+
self.channel.eventLoop.assertInEventLoop()
213213
self.provider.remoteClosed(connection: self, logger: logger)
214214
}
215215

0 commit comments

Comments
 (0)