ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Vinogradov ...@apache.org>
Subject Re: IgniteFuture -> CompletableFuture
Date Thu, 31 Aug 2017 12:09:37 GMT
Is it still actual to support java 7?

On Thu, Aug 31, 2017 at 11:03 AM, Yakov Zhdanov <yzhdanov@apache.org> wrote:

> CompletableFuture is part of java 8.
>
> --Yakov
>
> 2017-08-31 4:46 GMT+03:00 Dmitriy Setrakyan <dsetrakyan@apache.org>:
>
> > Igniters,
> >
> > I received the following proposal in my blog. I think this is useful. Any
> > thoughts?
> >
> > Please extend IgniteFuture by conversion method to CompletableFuture. I
> > > bored to write something like this:
> >
> >
> > > asyncCache.invoke(key, entryProcessor);
> > > CompletableFuture completableFuture = new CompletableFuture<>();
> > > IgniteFuture igniteFuture = asyncCache.future();
> > > IgniteInClosure> listener = (IgniteInClosure>) completedIgniteFuture
> -> {
> > > Throwable exception = null;
> > > T result = null;
> > > try {
> > > result = completedIgniteFuture.get();
> > > } catch (Throwable t) {
> > > exception = t;
> > > }
> > > if (exception != null) {
> > > completableFuture.completeExceptionally(exception);
> > > } else {
> > > completableFuture.complete(result);
> > > }
> > > };
> > > igniteFuture.listen(listener);
> > > return completableFuture;
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message