Is it possible to use dbClient non-blocking with coroutines and async controllers?
Hello @MikhailNazarov ,
The short answer is - this API is not implemented yet. At the moment we encourage to use simple API in case you need ORM.
However, it is possible: You need a thread pool...
- You post DB request to thread pool from Coroutine (coroutine waits asynchronously without blocking the processing loop).
- Once request is ready - result is returned back to Coroutine.
This is the way it will be implemented in the future (with some convenience APIs).
Thank you, you have a great framework. With this feature will be the best!
Does oatpp have a thread pool implementation? I found the Pool class - use it for a thread pool?
Do I understand correctly that for this task I need to use the IOEventWorker?
At the moment oatpp doesn't have thread-pool implementation.
I found the Pool class - use it for a thread pool?
That pool is a kind of resource pool - it's used for ConnectionPool in ORM and Network. It also can be used for any resource.
But it's not suitable for threads - just because of the performance - you don't want to start-stop new threads in the thread pool.
Do I understand correctly that for this task I need to use the IOEventWorker?
You don't have to use it directly. Oatpp does that for you.