You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2024/12/16 07:46:10 UTC
(james-project) 01/11: [PERF] interface for publishing several messages at once
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 <bt...@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-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org