Skip Menu |
 

This queue is for tickets about the future CPAN distribution.

Report information
The Basics
Id: 122892
Status: open
Priority: 0/
Queue: future

People
Owner: Nobody in particular
Requestors: richard [...] matrix.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Spam-Status: No, score=-1.999 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_FAIL=0.001] autolearn=no
X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings.
X-Spam-Flag: NO
Content-Language: en-US
content-type: text/plain; charset="utf-8"; format="flowed"
Message-ID: <61985c9b-ee3c-c76b-4024-ea7d31c8a4f3 [...] matrix.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -1.999
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 332E724031D for <cpan-bug+future [...] hipster.bestpractical.com>; Thu, 24 Aug 2017 18:37:39 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hdcWkJ757k9N for <cpan-bug+future [...] hipster.bestpractical.com>; Thu, 24 Aug 2017 18:37:38 -0400 (EDT)
Received: from xx1.develooper.com (xx1.develooper.com [207.171.7.115]) by hipster.bestpractical.com (Postfix) with ESMTPS id 0BA9D2401BD for <bug-future [...] rt.cpan.org>; Thu, 24 Aug 2017 18:37:37 -0400 (EDT)
Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id 0046E11E025 for <bug-future [...] rt.cpan.org>; Thu, 24 Aug 2017 15:37:35 -0700 (PDT)
Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id 3FF7611F44B for <bug-future [...] rt.cpan.org>; Thu, 24 Aug 2017 15:37:32 -0700 (PDT)
Received: from hermes.matrix.org (hermes.matrix.org [83.136.254.153]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id B72F411E025 for <bug-future [...] rt.cpan.org>; Thu, 24 Aug 2017 15:37:28 -0700 (PDT)
Received: from [2001:8b0:ba7a:e98f:3252:cbff:fee8:6489] by hermes.matrix.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <richard [...] matrix.org>) id 1dl0eM-0000hC-0N for bug-future [...] rt.cpan.org; Thu, 24 Aug 2017 22:30:54 +0000
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] matrix.org
Delivered-To: cpan-bug+future [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
Subject: needs_all cancels subfutures on failure, even if they have other actions pending
Return-Path: <richard [...] matrix.org>
X-RT-Mail-Extension: future
X-Original-To: cpan-bug+future [...] hipster.bestpractical.com
Dkim-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=matrix.org; s=00; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Message-ID:Subject:From:To; bh=K+a7KaOwEnHRhYOeO4OmTjpVuTC6mwxTRESBWrI5F/M=; b=drfnA9ujbxRKbU0DBEZpCuPagktz8/XDiyy9JNB6pMt6qQ6NDukgwbwkms2dLHpjmZEOgyCYRtWpQxwe73cVgBaDKv1WsZqmDbJmnFJav6x0wKZ8gbYBHJ+ar/s3NjUPhFuDU6vbI/yAUjAD7MKPPuLGCxMzs8RYrO8nd6KwstiLuX5LjArjEQQdt15p5m+KH93Yu+frQDVCb+Wt1Cd0gWWqmezOFBt/sYBVTLA+NnGaKZN1cqRSpDkDeVTxjdbnuHZYj5kLU/cSOoN+3TZNiWnyVNDmE8yzMaexlBjk3QGdj3XGlJ99f/0Eq9vbO+7NdNLQFkeztySzuf4o/b3CPw==;
X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_600_699 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, FROM_NAME_PHRASE 0, NO_CTA_URI_FOUND 0, NO_URI_FOUND 0, NO_URI_HTTPS 0, SPF_PASS 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __HAS_FROM 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MOZILLA_USER_AGENT 0, __NO_HTML_TAG_RAW 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __USER_AGENT 0, __zen.spamhaus.org_ERROR '
Date: Thu, 24 Aug 2017 23:30:53 +0100
X-Spam-Level:
X-Greylist: delayed 392 seconds by postgrey-1.34 at xx1.develooper.com; Thu, 24 Aug 2017 15:37:29 PDT
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2017.8.24.223316
To: bug-future [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Richard van der Hoff <richard [...] matrix.org>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 621
Download (untitled) / with headers
text/plain 621b
Suppose I have two inputs, A and B. Once A completes, I want to do C. Once A *and* B complete, I want to do D. But what if B fails? I still want to do C when A completes. Basically, I expect the following code to print "a done", and it doesn't. use Future; my $future_a = Future->new; my $future_b = Future->new; $future_a -> on_done(sub { print "a done\n"; }); my $future_d = Future->needs_all($future_a, $future_b); $future_b->fail("foo"); $future_a->done("bar"); The problem is of course that needs_all is cancelling the input futures. This seems like a dangerous thing to do. (perl v5.22.1, Future 0.35)
MIME-Version: 1.0
In-Reply-To: <61985c9b-ee3c-c76b-4024-ea7d31c8a4f3 [...] matrix.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <61985c9b-ee3c-c76b-4024-ea7d31c8a4f3 [...] matrix.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-7916-1511371536-558.122892-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1147
Download (untitled) / with headers
text/plain 1.1k
See https://rt.cpan.org/Ticket/Display.html?id=96685 for more details, but the step you're missing here is the ->without_cancel method: use Future; my $future_a = Future->new; my $future_b = Future->new; $future_a -> on_done(sub { print "a done\n"; }); my $future_d = Future->needs_all(map $_->without_cancel, $future_a, $future_b); $future_b->fail("foo"); $future_a->done("bar"); cheers, Tom On 2017-08-24 23:37:40, richard@matrix.org wrote: Show quoted text
> Suppose I have two inputs, A and B. Once A completes, I want to do C. > Once A *and* B complete, I want to do D. > > But what if B fails? I still want to do C when A completes. Basically, I > expect the following code to print "a done", and it doesn't. > > > use Future; > > my $future_a = Future->new; > my $future_b = Future->new; > > $future_a -> on_done(sub { print "a done\n"; }); > > my $future_d = Future->needs_all($future_a, $future_b); > > $future_b->fail("foo"); > $future_a->done("bar"); > > > The problem is of course that needs_all is cancelling the input futures. > This seems like a dangerous thing to do. > > (perl v5.22.1, Future 0.35)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.