This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 69e88bdf4bcf41feccba1cd9f3140911e9240b3f Author: Benoit TELLIER <btell...@linagora.com> AuthorDate: Tue Dec 10 21:35:56 2024 +0100 [PERF] interface for publishing several messages at once --- .../main/java/org/apache/james/events/EventBus.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/event-bus/api/src/main/java/org/apache/james/events/EventBus.java b/event-bus/api/src/main/java/org/apache/james/events/EventBus.java index 418af9dd77..52b7ef76b4 100644 --- a/event-bus/api/src/main/java/org/apache/james/events/EventBus.java +++ b/event-bus/api/src/main/java/org/apache/james/events/EventBus.java @@ -71,14 +71,24 @@ public interface EventBus { Mono<Void> dispatch(Event event, Set<RegistrationKey> key); - Mono<Void> reDeliver(Group group, Event event); - - EventBusName eventBusName(); - default Mono<Void> dispatch(Event event, RegistrationKey key) { return dispatch(event, ImmutableSet.of(key)); } + record EventWithRegistrationKey(Event event, Set<RegistrationKey> keys) { + + } + + default Mono<Void> dispatch(Collection<EventWithRegistrationKey> events) { + return Flux.fromIterable(events) + .concatMap(event -> dispatch(event.event(), event.keys())) + .then(); + } + + Mono<Void> reDeliver(Group group, Event event); + + EventBusName eventBusName(); + default Registration register(EventListener.GroupEventListener groupListener) { return register(EventListener.wrapReactive(groupListener)); } --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org