com.infomaximum.cluster.graphql.executor.struct.GSubscriptionPublisher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cluster-graphql Show documentation
Show all versions of cluster-graphql Show documentation
Library for creating a light cluster
package com.infomaximum.cluster.graphql.executor.struct;
import graphql.ExecutionResult;
import graphql.execution.reactive.SubscriptionPublisher;
import org.reactivestreams.FlowAdapters;
import org.reactivestreams.Subscriber;
import java.util.concurrent.Flow;
public class GSubscriptionPublisher implements Flow.Publisher {
private final SubscriptionPublisher sp;
public GSubscriptionPublisher(SubscriptionPublisher sp) {
this.sp = sp;
}
@Override
public void subscribe(Flow.Subscriber super D> subscriber) {
sp.subscribe((Subscriber super ExecutionResult>) FlowAdapters.toSubscriber(subscriber));
}
}