Sergey Luchko
Sergey Luchko

Reputation: 3336

Spring WebFlux create pool of no-blocking threads

I decided to rewrite my web app on Java(previously it was on Python). In my app I used no-blocking I/O, I had worker pool(Celery + Eventlet threads) where I pass tasks which consists of hundreds of API calls.

Now I'm using Spring WebFlux but I can't understand how I can create a workers pool to pass my tasks to that pool, and after get results and do some calculations.

(I know about possibility to create ThreadPoolTaskExecutor, but the threads are blocking threads)

Upvotes: 2

Views: 3925

Answers (1)

Brian Clozel
Brian Clozel

Reputation: 59056

If you're using non-blocking APIs, you don't need to schedule tasks on specific threads - Reactor is doing that for you. With Spring WebFlux, the threads used for processing work are managed by Reactor or it is reusing the Netty threads.

Check out the Schedulers and threading parts of the reactor reference documentation.

Upvotes: 1

Related Questions