Skip to content

Commit 94fe07a

Browse files
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d5ddd95 commit 94fe07a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/kotlin/de/slne/redis/stream/RedisStreamEventBus.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,9 @@ class RedisStreamEventBus(
264264
/**
265265
* Close the stream consumer and clean up resources.
266266
*/
267-
fun close() {
267+
suspend fun close() {
268268
isRunning = false
269-
consumerJob?.cancel()
270-
runBlocking {
271-
consumerJob?.join()
272-
}
269+
consumerJob?.cancelAndJoin()
273270
coroutineScope.cancel()
274271
connection.close()
275272
}

0 commit comments

Comments
 (0)