All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.reactivecommons.async.impl.QueryExecutor Maven / Gradle / Ivy

package org.reactivecommons.async.impl;


import org.reactivecommons.async.api.handlers.QueryHandler;
import org.reactivecommons.async.impl.communications.Message;
import reactor.core.publisher.Mono;

import java.util.function.Function;

public class QueryExecutor {
    private final QueryHandler queryHandler;
    private final Function converter;

    public QueryExecutor(QueryHandler queryHandler, Function converter) {
        this.queryHandler = queryHandler;
        this.converter = converter;
    }

    public Mono execute(Message rawMessage){
        return queryHandler.handle(converter.apply(rawMessage));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy