Skip to content

Commit

Permalink
Rename XxxThreadPoolSupplier to XxxThreadSupplier
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Apr 1, 2024
1 parent 42ebc8b commit b4d9f3e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ class ThreadService implements HttpService {
* The second is a virtual thread executor service.
* See `application.yaml` for configuration of each of these.
*/
ThreadPoolSupplier platformThreadPoolSupplier = ThreadPoolSupplier.builder()
ThreadPoolSupplier platformThreadSupplier = ThreadPoolSupplier.builder()
.config(appConfig.get("application-platform-executor"))
.build();
platformExecutorService = platformThreadPoolSupplier.get();
platformExecutorService = platformThreadSupplier.get();

ThreadPoolSupplier virtualThreadPoolSupplier = ThreadPoolSupplier.builder()
ThreadPoolSupplier virtualThreadSupplier = ThreadPoolSupplier.builder()
.config(appConfig.get("application-virtual-executor"))
.build();
virtualExecutorService = virtualThreadPoolSupplier.get();
virtualExecutorService = virtualThreadSupplier.get();
}

@Override
Expand All @@ -91,8 +91,8 @@ public void routing(HttpRules rules) {
private void computeHandler(ServerRequest request, ServerResponse response) {
int iterations = request.path().pathParameters().first("iterations").asInt().orElse(1);
try {
// We execute the computation on a platform thread. This prevents pining of the virtual
// thread, plus provides us the ability to limit the number of concurrent computation requests
// We execute the computation on a platform thread. This prevents unbounded obstruction of virtual
// threads, plus provides us the ability to limit the number of concurrent computation requests
// we handle by limiting the thread pool work queue length (as defined in application.yaml)
Future<Double> future = platformExecutorService.submit(() -> compute(iterations));
response.send(future.get().toString());
Expand Down

0 comments on commit b4d9f3e

Please sign in to comment.