當前位置: 首頁>>代碼示例>>Java>>正文


Java Flux.empty方法代碼示例

本文整理匯總了Java中reactor.core.publisher.Flux.empty方法的典型用法代碼示例。如果您正苦於以下問題:Java Flux.empty方法的具體用法?Java Flux.empty怎麽用?Java Flux.empty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在reactor.core.publisher.Flux的用法示例。


在下文中一共展示了Flux.empty方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findAllImages

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
public Flux<Image> findAllImages() {
	try {
		return Flux.fromIterable(
				Files.newDirectoryStream(Paths.get(UPLOAD_ROOT)))
			.map(path ->
				new Image(path.hashCode(),
					path.getFileName().toString()));
	} catch (IOException e) {
		return Flux.empty();
	}
}
 
開發者ID:PacktPublishing,項目名稱:Learning-Spring-Boot-2.0-Second-Edition,代碼行數:12,代碼來源:ImageService.java

示例2: apply

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
protected Flux<?> apply(Flux<?> input) {
	if (this.function != null) {
		return function.apply(input);
	}
	if (this.consumer != null) {
		this.consumer.accept(input);
		return Flux.empty();
	}
	if (this.supplier != null) {
		return this.supplier.get();
	}
	throw new IllegalStateException("No function defined");
}
 
開發者ID:kbastani,項目名稱:service-block-samples,代碼行數:14,代碼來源:SpringFunctionInitializer.java

示例3: getConfigAttributes

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
public Flux<ConfigAttribute> getConfigAttributes(ServerWebExchange exchange) {
	for(Map.Entry<ServerWebExchangeMatcher,SecurityConfig> entry : mappings.entrySet()) {
		if(entry.getKey().matches(exchange).isMatch()) {
			return Flux.just(entry.getValue());
		}
	}
	return Flux.empty();
}
 
開發者ID:guilhebl,項目名稱:item-shop-reactive-backend,代碼行數:9,代碼來源:ServerWebExchangeMetadataSource.java

示例4: convertToFlux

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
private Flux<?> convertToFlux(Object[] params) {
    if (params.length == 0) {
        return Flux.empty();
    }
    Object firstParam = params[0];
    if (firstParam instanceof Collection){
        return Flux.fromIterable((Collection) firstParam);
    }
    return Flux.just(firstParam);
}
 
開發者ID:fnproject,項目名稱:fdk-java,代碼行數:11,代碼來源:SpringCloudFunctionInvoker.java

示例5: emptyFlux

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
Flux<String> emptyFlux() {
    return Flux.empty();
}
 
開發者ID:aliaksei-lithium,項目名稱:spring5demo,代碼行數:4,代碼來源:FluxSampleTest.java

示例6: getEmptyFluxStream

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
@Override
public Flux<Employee> getEmptyFluxStream() {
	Flux<Employee> empListEmpty = Flux.empty();
	return empListEmpty;
}
 
開發者ID:PacktPublishing,項目名稱:Spring-5.0-Cookbook,代碼行數:6,代碼來源:EmployeeStreamServiceImpl.java

示例7: getAccessCertificates

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
@Override
@Transactional
public Flux<SignedAccessCertificateResource> getAccessCertificates(DeviceNonceAuthentication nonceAuthentication) {
    requireNonNull(nonceAuthentication, "`nonceAuthentication` must not be null");

    DeviceEntity device = deviceRepository.findBySerialNumber(nonceAuthentication.getDeviceSerialNumber())
            .orElseThrow(() -> new NotFoundException("DeviceEntity not found"));

    verifyNonceAuthOrThrow(nonceAuthentication, device.getPublicKey());

    List<AccessCertificateEntity> accessCertificates = findValidAndRemoveExpired(device);

    if (!device.isEnabled()) {
        log.info("Removing {} access certificates for disabled device {}", accessCertificates.size(), device.getId());
        // remove access certificates for disabled devices instead of throwing error
        // so the device certificates will be removed from the device.
        accessCertificateRepository.delete(accessCertificates);
        return Flux.empty();
    }

    Map<Long, VehicleEntity> vehicles = fetchVehicles(accessCertificates);

    return Flux.fromIterable(accessCertificates)
            .map(accessCertificateEntity -> {
                VehicleEntity vehicle = vehicles.get(accessCertificateEntity.getVehicleId());

                SignedAccessCertificateImpl signedAccessCertificate = SignedAccessCertificateImpl.builder()
                        .deviceAccessCertificateBase64(accessCertificateEntity
                                .getDeviceAccessCertificateBase64())
                        .deviceAccessCertificateSignatureBase64(accessCertificateEntity
                                .getDeviceAccessCertificateSignatureBase64()
                                .orElseThrow(IllegalStateException::new))
                        .signedDeviceAccessCertificateBase64(accessCertificateEntity
                                .getSignedDeviceAccessCertificateBase64()
                                .orElseThrow(IllegalStateException::new))
                        .vehicleAccessCertificateBase64(accessCertificateEntity
                                .getVehicleAccessCertificateBase64())
                        .vehicleAccessCertificateSignatureBase64(accessCertificateEntity
                                .getVehicleAccessCertificateSignatureBase64()
                                .orElseThrow(IllegalStateException::new))
                        .signedVehicleAccessCertificateBase64(accessCertificateEntity
                                .getSignedVehicleAccessCertificateBase64()
                                .orElseThrow(IllegalStateException::new))
                        .build();

                SignedAccessCertificateResource signedAccessCertificateResource = SignedAccessCertificateResourceImpl.builder()
                        .uuid(UUID.fromString(accessCertificateEntity.getUuid()))
                        .name(vehicle.getName())
                        .signedAccessCertificate(signedAccessCertificate)
                        .build();
                return signedAccessCertificateResource;
            });
}
 
開發者ID:amvnetworks,項目名稱:amv-access-api-poc,代碼行數:54,代碼來源:AccessCertificateServiceImpl.java

示例8: invoke

import reactor.core.publisher.Flux; //導入方法依賴的package包/類
@Override
public Flux<?> invoke(Flux<?> arg) {
    consumer.accept(arg);
    return Flux.empty();
}
 
開發者ID:fnproject,項目名稱:fdk-java,代碼行數:6,代碼來源:SpringCloudConsumer.java


注:本文中的reactor.core.publisher.Flux.empty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。