Skip Menu |
Report information
Id: 130920
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: comdog <brian.d.foy [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
Subject: Tap's closing callback doesn't call back
From: brian d foy <brian.d.foy [...] gmail.com>
Date: Sat, 4 Mar 2017 18:23:14 -0300
Download (untitled) / with headers
text/plain 401b
This is the example from the Tap docs. I expect the output to be "Tap closed", but I get no output using 2017.01: my $s = Supplier.new; my $tap = $s.Supply.tap( -> $v { say "the value is $v" }, done => { say "Supply is done" }, closing => { say "Tap closed" }, quit => -> $ex { say "Supply finished with error $ex" }, ); # later $tap.close;
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 684b
On Sat, 04 Mar 2017 13:24:08 -0800, comdog wrote: Show quoted text
> This is the example from the Tap docs. I expect the output to be > "Tap closed", but I get no output using 2017.01: > > my $s = Supplier.new; > my $tap = $s.Supply.tap( > -> $v { say "the value is $v" }, > done => { say "Supply is done" }, > closing => { say "Tap closed" }, > quit => -> $ex { say "Supply finished with error $ex" }, > ); > > # later > $tap.close;
I don't see `closing` param for that routine: https://github.com/rakudo/rakudo/blob/b597398/src/core/Supply.pm#L77 Unless this was missed during pre-Christmas Supplies rework, this may be just a doc bug.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 951b
On Sat, 04 Mar 2017 13:40:22 -0800, cpan@zoffix.com wrote: Show quoted text
> On Sat, 04 Mar 2017 13:24:08 -0800, comdog wrote:
> > This is the example from the Tap docs. I expect the output to be > > "Tap closed", but I get no output using 2017.01: > > > > my $s = Supplier.new; > > my $tap = $s.Supply.tap( > > -> $v { say "the value is $v" }, > > done => { say "Supply is done" }, > > closing => { say "Tap closed" }, > > quit => -> $ex { say "Supply finished with error $ex" }, > > ); > > > > # later > > $tap.close;
> > > I don't see `closing` param for that routine: > https://github.com/rakudo/rakudo/blob/b597398/src/core/Supply.pm#L77 > > Unless this was missed during pre-Christmas Supplies rework, this may > be just a doc bug.
It's a doc bug (and, yes, probably a left-behind from an earlier design). The correct way is using `on-close`. Example: my $t = Supply.interval(0.5).on-close({ say "bye" }).tap(&say); sleep 3; $t.close
To: perl6-bugs-followup [...] perl.org
Subject: Re: [perl #130920] [CONC] Tap's closing callback doesn't call back
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Date: Wed, 8 Mar 2017 22:24:42 +0100
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
> On 8 Mar 2017, at 18:09, jnthn@jnthn.net via RT <perl6-bugs-followup@perl.org> wrote: > > On Sat, 04 Mar 2017 13:40:22 -0800, cpan@zoffix.com wrote:
>> On Sat, 04 Mar 2017 13:24:08 -0800, comdog wrote:
>>> This is the example from the Tap docs. I expect the output to be >>> "Tap closed", but I get no output using 2017.01: >>> >>> my $s = Supplier.new; >>> my $tap = $s.Supply.tap( >>> -> $v { say "the value is $v" }, >>> done => { say "Supply is done" }, >>> closing => { say "Tap closed" }, >>> quit => -> $ex { say "Supply finished with error $ex" }, >>> ); >>> >>> # later >>> $tap.close;
>> >> >> I don't see `closing` param for that routine: >> https://github.com/rakudo/rakudo/blob/b597398/src/core/Supply.pm#L77 >> >> Unless this was missed during pre-Christmas Supplies rework, this may >> be just a doc bug.
> > It's a doc bug (and, yes, probably a left-behind from an earlier design). The correct way is using `on-close`. Example: > > my $t = Supply.interval(0.5).on-close({ say "bye" }).tap(&say); > sleep 3; > $t.close
I wonder whether these “public” functions should handle / warn about unknown named parameters being passed.
Download (untitled) / with headers
text/plain 1.4k
On Wed, 08 Mar 2017 13:25:56 -0800, elizabeth wrote: Show quoted text
>
> > On 8 Mar 2017, at 18:09, jnthn@jnthn.net via RT <perl6-bugs- > > followup@perl.org> wrote: > > > > On Sat, 04 Mar 2017 13:40:22 -0800, cpan@zoffix.com wrote:
> >> On Sat, 04 Mar 2017 13:24:08 -0800, comdog wrote:
> >>> This is the example from the Tap docs. I expect the output to be > >>> "Tap closed", but I get no output using 2017.01: > >>> > >>> my $s = Supplier.new; > >>> my $tap = $s.Supply.tap( > >>> -> $v { say "the value is $v" }, > >>> done => { say "Supply is done" }, > >>> closing => { say "Tap closed" }, > >>> quit => -> $ex { say "Supply finished with error $ex" }, > >>> ); > >>> > >>> # later > >>> $tap.close;
> >> > >> > >> I don't see `closing` param for that routine: > >> https://github.com/rakudo/rakudo/blob/b597398/src/core/Supply.pm#L77 > >> > >> Unless this was missed during pre-Christmas Supplies rework, this > >> may > >> be just a doc bug.
> > > > It's a doc bug (and, yes, probably a left-behind from an earlier > > design). The correct way is using `on-close`. Example: > > > > my $t = Supply.interval(0.5).on-close({ say "bye" }).tap(&say); > > sleep 3; > > $t.close
> > I wonder whether these “public” functions should handle / warn about > unknown named parameters being passed.
The docs have been updated in order to reflect current behavior, see for example: https://docs.perl6.org/type/Supply#method_on-close and https://docs.perl6.org/type/Tap Closing issue


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

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org