Java Code Examples for io.micronaut.core.async.publisher.Publishers#fromCompletableFuture()

The following examples show how to use io.micronaut.core.async.publisher.Publishers#fromCompletableFuture() . 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
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T> Publisher<T> findOne(@NonNull Class<T> type, @NonNull Serializable id) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.findOne(type, id)
    );
}
 
Example 2
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T, R> Publisher<R> findOne(@NonNull PreparedQuery<T, R> preparedQuery) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.findOne(preparedQuery)
    );
}
 
Example 3
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T> Publisher<T> findOptional(@NonNull Class<T> type, @NonNull Serializable id) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.findOptional(type, id)
    );
}
 
Example 4
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T, R> Publisher<R> findOptional(@NonNull PreparedQuery<T, R> preparedQuery) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.findOptional(preparedQuery)
    );
}
 
Example 5
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T> Publisher<Long> count(PagedQuery<T> pagedQuery) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.count(pagedQuery)
    );
}
 
Example 6
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <R> Publisher<Page<R>> findPage(@NonNull PagedQuery<R> pagedQuery) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.findPage(pagedQuery)
    );
}
 
Example 7
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T> Publisher<T> persist(@NonNull InsertOperation<T> entity) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.persist(entity)
    );
}
 
Example 8
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T> Publisher<T> update(@NonNull UpdateOperation<T> operation) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.update(operation)
    );
}
 
Example 9
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public Publisher<Number> executeUpdate(@NonNull PreparedQuery<?, Number> preparedQuery) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.executeUpdate(preparedQuery)
    );
}
 
Example 10
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public <T> Publisher<Number> deleteAll(BatchOperation<T> operation) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.deleteAll(operation)
    );
}
 
Example 11
Source File: ExecutorReactiveOperations.java    From micronaut-data with Apache License 2.0 4 votes vote down vote up
@Override
public <T> Publisher<Boolean> exists(@NonNull PreparedQuery<T, Boolean> preparedQuery) {
    return Publishers.fromCompletableFuture(() ->
            asyncOperations.exists(preparedQuery)
    );
}