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.done doesn't seem to terminate anything #3617

Closed
p6rt opened this issue Dec 22, 2014 · 5 comments
Closed

Supply.done doesn't seem to terminate anything #3617

p6rt opened this issue Dec 22, 2014 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Dec 22, 2014

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

Searchable as RT123477$

@p6rt
Copy link
Author

p6rt commented Dec 22, 2014

From @moritz

moritz> m​: my $s = Supply.new; $s.tap(&say); $s.done; $s.emit('still here')
camelia> rakudo-moar 284c09​: OUTPUT«still here␤»

This is likely a bug; .done should either shut down the supply (and so
forbid future .emit calls), or at least throw out the taps. Currently it
only distributes .done messages to all tappers, which seems exceedingly
weak.

@p6rt
Copy link
Author

p6rt commented Dec 22, 2014

From @moritz

On Mon Dec 22 06​:37​:08 2014, moritz wrote​:

moritz> m​: my $s = Supply.new; $s.tap(&say); $s.done; $s.emit('still here')
camelia> rakudo-moar 284c09​: OUTPUT«still here␤»

This is likely a bug; .done should either shut down the supply (and so
forbid future .emit calls), or at least throw out the taps. Currently it
only distributes .done messages to all tappers, which seems exceedingly
weak.

The same is true for .quit; it doesn't shut down the channel in any way either.

Thus there's a currently a big overlap in functionality between quit, done and close, which is very confusing.

@p6rt
Copy link
Author

p6rt commented Nov 26, 2015

From @jnthn

On Mon Dec 22 06​:37​:08 2014, moritz wrote​:

moritz> m​: my $s = Supply.new; $s.tap(&say); $s.done; $s.emit('still here')
camelia> rakudo-moar 284c09​: OUTPUT«still here␤»

This is likely a bug; .done should either shut down the supply (and so
forbid future .emit calls), or at least throw out the taps. Currently it
only distributes .done messages to all tappers, which seems exceedingly
weak.

Supplies now go to some effort to enforce the supply grammar (emit* [done|quit]); you have to go out of your way (like, actually ask for an unsanitized supply) to get the previous behavior (which you may occasionally want to do for performance reasons). Tests in S17-supply/basic.t. Note that values emitted after a done will simply be dropped, so the grammar is followed from an observers point of view.

/jnthn

@p6rt
Copy link
Author

p6rt commented Nov 26, 2015

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

@p6rt
Copy link
Author

p6rt commented Nov 26, 2015

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

@p6rt p6rt closed this as completed Nov 26, 2015
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