Java Code Examples for reactor.core.publisher.Mono#fromCompletionStage()

The following examples show how to use reactor.core.publisher.Mono#fromCompletionStage() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public Mono<Void> assign(Collection<Partition> partitions) {
    Objects.requireNonNull(partitions, "Partitions cannot be null");

    Set<TopicPartition> vertxPartitions = partitions
        .stream()
        .map(this::toVertxTopicPartition)
        .collect(Collectors.toSet());

    return Mono.fromCompletionStage(() -> delegate.assign(vertxPartitions));
}
 
Example 2
@Override
public Mono<Void> seekToEnd(Collection<Partition> partitions) {
    Objects.requireNonNull(partitions, "Partitions cannot be null");

    Set<TopicPartition> vertxPartitions = partitions
        .stream()
        .map(this::toVertxTopicPartition)
        .collect(Collectors.toSet());

    return Mono.fromCompletionStage(() -> delegate.seekToEnd(vertxPartitions));
}
 
Example 3
Source Project: vertx-spring-boot   File: SnowdropPipe.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Mono<Void> to(WriteStream<T> destination) {
    return Mono.fromCompletionStage(() -> delegate.to(toAxleWriteStream(destination)));
}
 
Example 4
@Override
public Mono<Void> subscribe(Collection<String> topics) {
    Objects.requireNonNull(topics, "Topics cannot be null");

    return Mono.fromCompletionStage(() -> delegate.subscribe(new HashSet<>(topics)));
}
 
Example 5
@Override
public Mono<Void> close() {
    return Mono.fromCompletionStage(delegate::close);
}
 
Example 6
Source Project: titus-control-plane   File: JooqUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static <T> Mono<T> executeAsyncMono(Supplier<T> supplier, DSLContext dslContext) {
    return Mono.fromCompletionStage(executeAsync(supplier, dslContext));
}
 
Example 7
@Override
public Mono<Void> close() {
    return Mono.fromCompletionStage(delegate::close);
}
 
Example 8
@Override
public Mono<Void> seekToBeginning(Partition partition) {
    Objects.requireNonNull(partition, "Partition cannot be null");

    return Mono.fromCompletionStage(() -> delegate.seekToBeginning(toVertxTopicPartition(partition)));
}
 
Example 9
@Override
public Mono<Void> end(AmqpMessage message) {
    return Mono.fromCompletionStage(() -> delegate.end(messageConverter.toAxleMessage(message)));
}
 
Example 10
Source Project: titus-control-plane   File: JooqUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static <T> Mono<T> executeAsyncMono(Supplier<T> supplier, DSLContext dslContext) {
    return Mono.fromCompletionStage(executeAsync(supplier, dslContext));
}
 
Example 11
@Override
public Mono<Long> position(Partition partition) {
    Objects.requireNonNull(partition, "Partition cannot be null");

    return Mono.fromCompletionStage(() -> delegate.position(toVertxTopicPartition(partition)));
}
 
Example 12
@Override
public Mono<Long> beginningOffset(Partition partition) {
    Objects.requireNonNull(partition, "Partition cannot be null");

    return Mono.fromCompletionStage(() -> delegate.beginningOffsets(toVertxTopicPartition(partition)));
}
 
Example 13
@Override
public Mono<Long> endOffset(Partition partition) {
    Objects.requireNonNull(partition, "Partition cannot be null");

    return Mono.fromCompletionStage(() -> delegate.endOffsets(toVertxTopicPartition(partition)));
}
 
Example 14
@Override
public Mono<Void> commit() {
    return Mono.fromCompletionStage(delegate::commit);
}
 
Example 15
@Override
public Mono<Void> close() {
    return Mono.fromCompletionStage(delegate::close);
}
 
Example 16
@Override
public Mono<Void> close() {
    return Mono.fromCompletionStage(delegate::close);
}
 
Example 17
@Override
public Mono<Void> close(long timeout) {
    return Mono.fromCompletionStage(() -> delegate.close(timeout));
}
 
Example 18
@Override
public Mono<Void> close() {
    return Mono.fromCompletionStage(delegate::close);
}
 
Example 19
@Override
public Mono<Void> end() {
    return Mono.fromCompletionStage(delegate::end);
}
 
Example 20
@Override
public Mono<Void> write(AmqpMessage message) {
    return Mono.fromCompletionStage(() -> delegate.write(messageConverter.toAxleMessage(message)));
}