I have a function that takes 2 functions, one that watches for a specific event and the other that actually does the job, each of which fires in the future as soon as the event returns to the thread causing the downstream message. if the worker thread ends before the event has received the caller's stream, then the observer signal stops and then the caller returns.
This works fine, but the fact is that a work function that does / can do the actual work needs to check for other events in the queue, every time I need to monitor a specific event, I launch 2 additional futures. The question is, is there a limit to the number of running max futures? Sometimes I can get 60 futures? Will the pool flow grow as needed? and since they run in the thread pool, I assume they are not too expensive to create?
source share