Why the HandlerScheduler class overrides scheduleDirect. It's not more explicit to let the HandlerWorker do the work
notcaremath opened this issue · comments
notcare commented
Why the HandlerScheduler class overrides scheduleDirect. It's not more explicit to let the HandlerWorker do the work
David Karnok commented
A worker implementation is required to track all submitted tasks so they can be mass disposed. That adds overhead to use cases where only individual tasks need to be submitted. Such tasks are either tracked outside the scheduler or don't really need tracking.
notcare commented
I still don't understand why HandlerScheduler overrides the scheduleDirect method instead of using the Scheduler superclass method like IoScheduler and NewThreadScheduler
David Karnok commented
To avoid the uneccessary overhead of going through the HandlerWorker, as this particular type of scheduler can. Same logic as with Schedulers.single()
.
notcare commented
thank you very much for your help