Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C01F410B0B for ; Thu, 19 Feb 2015 13:47:04 +0000 (UTC) Received: (qmail 13561 invoked by uid 500); 19 Feb 2015 13:46:55 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 13524 invoked by uid 500); 19 Feb 2015 13:46:55 -0000 Mailing-List: contact dev-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list dev@ignite.incubator.apache.org Received: (qmail 13513 invoked by uid 99); 19 Feb 2015 13:46:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Feb 2015 13:46:55 +0000 X-ASF-Spam-Status: No, hits=-1997.8 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 19 Feb 2015 13:46:53 +0000 Received: (qmail 13290 invoked by uid 99); 19 Feb 2015 13:46:33 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Feb 2015 13:46:33 +0000 Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com [209.85.214.172]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id F1FE81A0292 for ; Thu, 19 Feb 2015 13:46:32 +0000 (UTC) Received: by mail-ob0-f172.google.com with SMTP id nt9so14417926obb.3 for ; Thu, 19 Feb 2015 05:46:32 -0800 (PST) X-Gm-Message-State: ALoCoQldxXNfWzDV4p40GF2vHrEbRQ8GceiZdMRccaMqGu+lz9IAUlqhHvZIpr2dkFaZqPbIr9sX MIME-Version: 1.0 X-Received: by 10.182.163.78 with SMTP id yg14mr2986536obb.13.1424353592157; Thu, 19 Feb 2015 05:46:32 -0800 (PST) Received: by 10.76.167.37 with HTTP; Thu, 19 Feb 2015 05:46:32 -0800 (PST) In-Reply-To: References: Date: Thu, 19 Feb 2015 17:46:32 +0400 Message-ID: Subject: Re: Serializable futures? From: Yakov Zhdanov To: dev@ignite.incubator.apache.org Content-Type: multipart/alternative; boundary=e89a8f642fb4e5404c050f71290c X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f642fb4e5404c050f71290c Content-Type: text/plain; charset=UTF-8 Guys, I looked a bit closer to java8 future. It has pretty cool features, but I suggest not to backport them. For now we have listenAsync() and chain() methods and if anyone needs such rich functionality he can implement that. We will definitely implement CompletableFuture as a part of java8 migration, but a bit later. So, if there are no objections let's proceed with the issues (ticket updated): 1. Rename listenAsync(lsnr) -> listen(lsnr) 1.1 Async listening may be implemented inside listener itself - handlong logic will be submitted to some pool. Convenience adapters may be added. 1.2 Async chaining may be implemented in the same way. 1.3 Java8 returns futures from "listening" methods that get done when listener completes. I don's think we should implement it now. Let's postpone it. 2. we can remove context - it will not be used in future any more 3. remove boolean fields that manage async settings 4. remove validity check + externalizable 5. remove listeners collection, but have 1 listener and chain them if needed. I suspect in 99% of cases we have only 1 listener. --Yakov 2015-02-10 13:57 GMT+03:00 Dmitriy Setrakyan : > My only comment is that it seems to be a big rework and should not be > addressed in this sprint. I also suggest that we look at CompletableFuture > from JDK8: > > https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html > > D. > > On Tue, Feb 10, 2015 at 1:54 AM, Yakov Zhdanov > wrote: > > > Guys, I think that we should rework our future to make it more clean and > > lightweight. > > > > 1. remove async notification - everyone can create listener that executes > > in async manner > > 2. we can remove context - it will not be used in future any more > > 3. remove boolean fields that manage async settings > > 4. remove validity check + externalizable > > 5. remove listeners collection, but have 1 listener and chain them if > > needed. I suspect in 99% of cases we have only 1 listener. > > > > Feel free to comment - https://issues.apache.org/jira/browse/IGNITE-216 > > > > -- > > Yakov Zhdanov, Director R&D > > *GridGain Systems* > > www.gridgain.com > > > > 2015-02-10 3:52 GMT+03:00 Dmitriy Setrakyan : > > > > > +1 > > > > > > On Mon, Feb 9, 2015 at 4:35 PM, Valentin Kulichenko < > > > valentin.kulichenko@gmail.com> wrote: > > > > > > > Igniters, > > > > > > > > Anyone knows why GridFutureAdapter implements Externalizable? This is > > > > useless from my point of view and error-prone, because it forces him > to > > > > have default constructor. It's invalid to use it directly in code, > but > > > for > > > > some reason there are 84 (!!!) usages and I just caught an assertion > > > > because of one of them. > > > > > > > > I think we should remove Externalizable from futures, remove default > > > > constructor and revisit all wrong usages. > > > > > > > > If there are no objections, I will create a ticket. > > > > > > > > Thanks! > > > > -- > > > > Valentin > > > > > > > > > > --e89a8f642fb4e5404c050f71290c--