score:5

Accepted answer

there is no need to 'futurise' anything unless that method has asynchronous work to do, i.e. has to wait itself for futures. if the method takes too much time, the caller can always wrap the call into a future. i would therefore conclude, don't use future in your api until you really need it.

score:5

there barely exists situation when you may need the future result but should avoid it because of overhead.

whole future concept is described here

if in short - there is an executioncontext and it is responsible for all overhead. it receives small closures and is running them as it likes to. the more of such closures exists, the more it should handle.

every action creates new promise which is shown as future to you. every means each map, flatmap, filter and so on. each just do operation like foreach or oncomplete does not create new promise but register new closure in the executioncontext.

all of this is not specifically heavy, but if every your method will be returning a future it could be a problem.

so just follow reasonable minimalism, but if you need some streamed computation it's usually ok to make every step asynchronous.


Related Query

More Query from same tag