Yes.. I just looked into CompleteableFuture. This looks quite good already. So hopefully we get some more feedback on how to proceed.
Christian 2016-07-22 16:25 GMT+02:00 Johannes Utzig <[email protected]>: > Hi Christian, > > I have not stumbled upon this yet, but on first glance it looks very > similar to what you can do with a CompletableFuture: > > testService.helloAsync().thenAccept(result -> System.out.println(result)); > > Looks like the main difference is that Observable allows multiple items > that become available over time. > > But part of my change was a bit of a cleanup in the handling of the > InvocationStrategy which should make it easier to add support for > additional invocation strategies (like an Observable based). > As for the initial implementation I would prefer to keep it free of > additional mandatory dependencies. > > Johannes > > 2016-07-22 15:38 GMT+02:00 Christian Schneider <[email protected]>: > > > Hi Johannes, > > > > welcome to the Aries community and thanks for the pull requests and > issues > > you already provided. > > > > Long running calls could make a lot of sense but I am not sure if Future > > is still the way to go. > > It seems people are using Observable now ( > > http://reactivex.io/documentation/observable.html) to be able to use > > rxjava (https://github.com/ReactiveX/RxJava). > > > > So I think it might make sense to directly provide this. I am not > > experienced in rxjava but maybe we got some people here who know that > > better. > > > > Christian > > > > > > On 22.07.2016 15:00, Johannes Utzig wrote: > > > >> Hi, > >> > >> as a quick introduction, my name is Johannes Utzig and I work for the > >> SEEBURGER AG. > >> We have been involved with aries-rsa since the beginning and maintain a > >> fork of it on github. We are primarily interested in the fastbin > transport > >> and I usually try to create pull requests for enhancements/fixes we're > >> doing that might be useful to have upstream. > >> > >> I am currently working on adding support for long running remote calls > >> (several minutes/hours) to fastbin. > >> If possible, I would like to contribute that feature upstream if there > is > >> an interest for it. > >> The idea is to allow Future and CompletableFuture as return values of > >> remote methods. > >> If such a return value is detected, the invocation strategy switches to > >> async and the client receives an implementation of (Completable)Future > >> that > >> will be filled as soon as the call result becomes available. > >> > >> Example Provider: > >> > >> public CompletableFuture<String> helloAsync() { > >> return CompletableFuture.supplyAsync(() -> "Hello"); > >> } > >> > >> Example Consumer: > >> > >> exampleService.helloAsync().get(5, TimeUnit.MINUTES)); > >> > >> A few questions about that: > >> > >> -Does someone maybe have a better idea on how to support long > >> running/async > >> calls? > >> > >> -would you be interested in that contribution? > >> > >> -My implementation requires java 8 features like CompletableFuture but > rsa > >> is currently building with 1.7. Would it be OK to move to java 8 as a > >> target version? > >> > >> Best regards, > >> Johannes > >> > >> > > > > -- > > Christian Schneider > > http://www.liquid-reality.de > > > > Open Source Architect > > http://www.talend.com > > > > > -- -- Christian Schneider http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de> Open Source Architect http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
