-
-
Save toby55kij/ae29479ea61dbf9110fc3c656dea54a4 to your computer and use it in GitHub Desktop.
ブロッキング処理を呼び出す例3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Schedulers SCHEDULER = | |
Schedulers.newBoundedElastic(Schedulers.DEFAULT_BOUNDED_ELASTIC_SIZE, | |
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, | |
"my-boundedElestic", 60, true); | |
@GetMapping("/foo/{id}") | |
public Mono<ReturnValue> get(ServerWebeExchange exchange, @PathVariable Long id) { | |
return Mono.fromCallable(() -> { | |
return getValue(id); | |
}).subscribeOn(SCHEDULER); | |
} | |
ReturnValue getValue(long id) { | |
// ブロッキング処理 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment