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

io.mongock.driver.mongodb.reactive.util.SubscriberSync Maven / Gradle / Ivy

The newest version!
package io.mongock.driver.mongodb.reactive.util;

import org.reactivestreams.Subscription;

import java.util.Optional;

public interface SubscriberSync extends org.reactivestreams.Subscriber {

  default T getFirst() {
    return get().get(0);
  }

  MongoIterable get(long timeoutMS);

  Optional getError();

  Subscription getSubscription();

  MongoSubscriberSync await(long timeout);

  boolean isCompleted();

  default boolean isFailed() {
    return isCompleted() && getError() != null;
  }

  default MongoIterable get() {
    return get(Long.MAX_VALUE);
  }

  default MongoSubscriberSync await() {
    return await(Long.MAX_VALUE);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy