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

graphql.kickstart.execution.subscriptions.apollo.SubscriptionStopCommand Maven / Gradle / Ivy

package graphql.kickstart.execution.subscriptions.apollo;

import graphql.kickstart.execution.subscriptions.SubscriptionSession;
import java.util.Collection;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
class SubscriptionStopCommand implements SubscriptionCommand {

  private final Collection connectionListeners;

  @Override
  public void apply(SubscriptionSession session, OperationMessage message) {
    connectionListeners.forEach(it -> it.onStop(session, message));
    session.unsubscribe(message.getId());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy