Skip to content

Commit ebfdb97

Browse files
committed
better async parallel hook
1 parent 40cc1bc commit ebfdb97

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hooks/src/main/kotlin/com/intuit/hooks/AsyncParallelHook.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ public abstract class AsyncParallelHook<F : Function<*>> : AsyncBaseHook<F>("Asy
77
protected suspend fun call(invokeWithContext: suspend (F, HookContext) -> Unit) {
88
val context = setup(invokeWithContext)
99

10-
return taps.map { tapInfo ->
11-
coroutineScope {
10+
coroutineScope {
11+
taps.forEach { tapInfo ->
1212
launch {
1313
invokeWithContext(tapInfo.f, context)
1414
}
1515
}
16-
}.forEach {
17-
it.join()
1816
}
1917
}
2018
}

0 commit comments

Comments
 (0)