digital-garden/knowledge/dev/java/frameworks/quarkus/Выполнение блокирующего кода в реактивном потоке.md
2024-06-13 21:01:37 +03:00

21 lines
525 B
Markdown

---
aliases:
tags:
- зрелость/🌱
date:
- - 2023-11-22
zero-link:
- "[[00 Java разработка]]"
parents:
- "[[Quarkus]]"
linked:
---
```java
Uni<String> uni = Uni.createFrom()
.item(this::invokeRemoteServiceUsingBlockingIO)
.runSubscriptionOn(Infrastructure.getDefaultWorkerPool());
Multi<String> multi = Multi.createFrom().items("john", "jack", "sue")
.emitOn(Infrastructure.getDefaultWorkerPool())
.onItem().transform(this::invokeRemoteServiceUsingBlockingIO);
```