io.fluxcapacitor.javaclient.publishing.ResultGateway Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Default Java client library for interfacing with Flux Capacitor.
package io.fluxcapacitor.javaclient.publishing;
import io.fluxcapacitor.common.api.Metadata;
import io.fluxcapacitor.javaclient.common.Message;
public interface ResultGateway {
default void respond(Object response, String target, int requestId) {
if (response instanceof Message) {
respond(((Message) response).getPayload(), ((Message) response).getMetadata(), target, requestId);
} else {
respond(response, Metadata.empty(), target, requestId);
}
}
void respond(Object payload, Metadata metadata, String target, int requestId);
}