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.zip-latest locks up two Supply.interval supplies #5471

Closed
p6rt opened this issue Jul 21, 2016 · 4 comments
Closed

Supply.zip-latest locks up two Supply.interval supplies #5471

p6rt opened this issue Jul 21, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 21, 2016

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

Searchable as RT128694$

@p6rt
Copy link
Author

p6rt commented Jul 21, 2016

From @moritz

Consider this code​:

#!/usr/bin/env perl6

my $source = Supply.interval(1);
$source.tap({ say 'DEBUG​: source'});
my $heartbeat = Supply.interval(0.7);
$heartbeat.tap({ say 'DEBUG​: heartbeat'});
react {
  whenever $source.zip-latest($heartbeat) {
  say 'WHENEVER';
  }
}

# Output​:
# DEBUG​: source
# DEBUG​: heartbeat
# DEBUG​: heartbeat
# DEBUG​: source
# DEBUG​: heartbeat
#
# ... and then it hangs, and produces no output anymore.

The mere fact that I combine those two supplies with zip-latest stops
the original supplies from producing values (or at least from calling
the .tap), and the whenever block isn't executed either.

So either I totally misunderstood zip-latest, or it's totally b0rked. Or
both :-)

--
Moritz Lenz
https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

From @jnthn

On Thu Jul 21 14​:42​:42 2016, moritz wrote​:

Consider this code​:

#!/usr/bin/env perl6

my $source = Supply.interval(1);
$source.tap({ say 'DEBUG​: source'});
my $heartbeat = Supply.interval(0.7);
$heartbeat.tap({ say 'DEBUG​: heartbeat'});
react {
whenever $source.zip-latest($heartbeat) {
say 'WHENEVER';
}
}

# Output​:
# DEBUG​: source
# DEBUG​: heartbeat
# DEBUG​: heartbeat
# DEBUG​: source
# DEBUG​: heartbeat
#
# ... and then it hangs, and produces no output anymore.

The mere fact that I combine those two supplies with zip-latest stops
the original supplies from producing values (or at least from calling
the .tap), and the whenever block isn't executed either.

So either I totally misunderstood zip-latest, or it's totally b0rked. Or
both :-)

It should have worked. Since this RT was filed, multiple fixes have been made to supplies, and it seems one of them nailed this bug. I committed a test in S17-supply/zip-latest.t (and checked that it hung back in the June release, so it seems it covers it decently well).

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

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

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

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

@p6rt p6rt closed this as completed Oct 12, 2016
@p6rt p6rt added the conc label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant