
org.reactivecommons.async.impl.EventExecutor Maven / Gradle / Ivy
package org.reactivecommons.async.impl;
import org.reactivecommons.api.domain.DomainEvent;
import org.reactivecommons.async.api.handlers.EventHandler;
import org.reactivecommons.async.impl.communications.Message;
import reactor.core.publisher.Mono;
import java.util.function.Function;
public class EventExecutor {
private final EventHandler eventHandler;
private final Function> converter;
public EventExecutor(EventHandler eventHandler, Function> converter) {
this.eventHandler = eventHandler;
this.converter = converter;
}
public Mono execute(Message rawMessage){
return eventHandler.handle(converter.apply(rawMessage));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy