io.automatiko.addons.graphql.GraphQLEventPublisher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of automatiko-graphql-addon Show documentation
Show all versions of automatiko-graphql-addon Show documentation
GraphQL AddOn for Automatiko Engine
The newest version!
package io.automatiko.addons.graphql;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import jakarta.enterprise.context.ApplicationScoped;
import io.automatiko.engine.api.event.DataEvent;
import io.automatiko.engine.api.event.EventPublisher;
@ApplicationScoped
public class GraphQLEventPublisher implements EventPublisher {
private Set> subscribers = new HashSet<>();
@Override
public void publish(DataEvent> event) {
subscribers.forEach(s -> s.process(event));
}
@Override
public void publish(Collection> events) {
events.forEach(this::publish);
}
public void register(GraphQLSubscriptionEventPublisher> subscriber) {
this.subscribers.add(subscriber);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy