@@ -30,11 +30,6 @@ interface PublishStrategy {
3030 */
3131 val CONTINUE_ON_EXCEPTION : PublishStrategy = ContinueOnExceptionPublishStrategy ()
3232
33- /* *
34- * Publish strategy that executes handlers in parallel without waiting for completion.
35- */
36- val PARALLEL_NO_WAIT : PublishStrategy = ParallelNoWaitPublishStrategy ()
37-
3833 /* *
3934 * Publish strategy that executes handlers in parallel and waits for all to complete.
4035 */
@@ -91,28 +86,6 @@ interface PublishStrategy {
9186 ) = withContext(dispatcher) { notificationHandlers.forEach { it.handle(notification) } }
9287 }
9388
94- /* *
95- * Publish strategy that executes all handlers in parallel without waiting for completion.
96- * This is a "fire-and-forget" approach where the publish method returns immediately
97- * after launching all handler coroutines.
98- */
99- class ParallelNoWaitPublishStrategy : PublishStrategy {
100- /* *
101- * Publishes the notification to all handlers in parallel without waiting for completion.
102- * Each handler is launched in its own coroutine and the method returns immediately.
103- *
104- * @param T The type of notification to publish
105- * @param notification The notification instance to publish
106- * @param notificationHandlers Collection of handlers that will process the notification
107- * @param dispatcher The coroutine dispatcher to use for execution
108- */
109- override suspend fun <T : Notification > publish (
110- notification : T ,
111- notificationHandlers : Collection <NotificationHandler <T >>,
112- dispatcher : CoroutineDispatcher
113- ) = withContext(dispatcher) { notificationHandlers.forEach { launch { it.handle(notification) } } }
114- }
115-
11689 /* *
11790 * Publish strategy that executes all handlers in parallel and waits for all to complete.
11891 * If any handler throws an exception, it will be propagated after all handlers have completed.
0 commit comments