Async, non-blocking jobs execution
See original GitHub issueHi,
Your lib almost perfectly fits my use case. But, after code inspecting, I suppose there is no support for asynchronous, non blocking jobs.
What do I exactly mean? I have plenty of jobs to start (let’s say 10k/min). Each of it contains a HTTP request(s), which I call using non-blocking http client. So, I have eg. CompletableFuture[Response]
and based on the response I have to decide if reschedule the task instance or not (custom task and ExecutionHandler
seem to be great to do it). Currently, I have to block the thread, but this is not the way to go, because there is a lot of tasks to start (requirement: immediately or as soon as possible) and mean time of waiting for response can be ~30s. The thread is blocked and just waiting for IO.
It seems that it can be solved if db-scheduler could be able to define and use sth like async execution handler:
public interface ExecutionHandler<T> {
CompletableFuture<CompletionHandler<T>> execute(TaskInstance<T> taskInstance, ExecutionContext executionContext);
}
Or maybe I missed sth and there is a way to achieve sth like described above? If not, WDYT about the idea to introduce async interface and adapt db-scheduler to be able to work with it? Do you see any obstacles?
Thanks for your effort. This project and your care for it looks very impressive.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (6 by maintainers)
Top GitHub Comments
Me neither. I’ve not been there yet. But I’m going to consult with you all uncertain things here. Stay tuned 😃
I identified the interface which should be changed to introduce the fact that job can be done asynchronously.
I was going to start there.