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);
}
}