Hi folks, There was a discussion about not very good "withAsync()" API design [1]. As we are approaching Ignite 2.0 it is a good time to rework it. My considerations on how good API should look like and how should it be implemented:
1) Sync and async must be *different interfaces*. 2) All async methods must return *futures*. No thread-locals. 3) Sync operations normally* should not* be implemented through async. This is a long story - if we delegate to async, then we have to bother with additional threads, associated back-pressure control and all that crap. Sync call must be sync unless there is a very strong reason to go through async path. 4) Last, but not least - we should re-design our futures to be more like Java 8 *CompletableFuture*. It should be able to accept Executors to continue computation, it should have lots of methods to deal with continuations and joins, etc.. Ideally, it would be cool if could remove it and use CompletableFuture, but it is clearly too early to drop Java 7 support. So we should at least try making our futures similar to CompletableFuture. I will create relevant tickets soon. Thoughts? [1] http://apache-ignite-developers.2346864.n4.nabble.com/Net-separate-methods-for-async-operations-td3901.html