Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supply.Channel gets ".quit" instead of ".fail"ed when original Supply is quit #5156

Closed
p6rt opened this issue Feb 29, 2016 · 4 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Feb 29, 2016

Migrated from rt.perl.org#127629 (status was 'resolved')

Searchable as RT127629$

@p6rt
Copy link
Author

p6rt commented Feb 29, 2016

From @skids

$ perl6 -e 'my $r = Supplier.new; my $s = $r.Supply; my $c = $s.Channel; start { for @​$c { "got $_".say }; 42.say; }; sleep 0.5; for 1..4 { $r.emit($_); sleep 0.5 }; $r.quit(X​::AdHoc.new(​:message)); sleep 1;'
got 1
got 2
got 3
got 4
Method 'quit' not found for invocant of class 'Channel'
  in block <unit> at -e line 1

quoting jnthn​: "It's indeed a bug. It should really be calling .fail on the Channel, which should then be resulting in the exception being thrown in the for iteration."

Probably this is as simple as changing line 579 of Supply.pm

@p6rt
Copy link
Author

p6rt commented Mar 9, 2016

From @jnthn

On Sun Feb 28 19​:50​:40 2016, bri@​abrij.org wrote​:

$ perl6 -e 'my $r = Supplier.new; my $s = $r.Supply; my $c =
$s.Channel; start { for @​$c { "got $_".say }; 42.say; }; sleep 0.5;
for 1..4 { $r.emit($_); sleep 0.5 }; $r.quit(X​::AdHoc.new(​:message));
sleep 1;'
got 1
got 2
got 3
got 4
Method 'quit' not found for invocant of class 'Channel'
in block <unit> at -e line 1

quoting jnthn​: "It's indeed a bug. It should really be calling .fail
on the Channel, which should then be resulting in the exception being
thrown in the for iteration."

Probably this is as simple as changing line 579 of Supply.pm

There was a little more to it, since Channel.Supply was also dropping errors rather than passing them along. Fixed that also, and added test coverage to S17-supply/Channel.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Mar 9, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Mar 9, 2016
@p6rt
Copy link
Author

p6rt commented Mar 9, 2016

@jnthn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant