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

Interval supplies < 1ms can get stuck #5820

Closed
p6rt opened this issue Nov 24, 2016 · 4 comments
Closed

Interval supplies < 1ms can get stuck #5820

p6rt opened this issue Nov 24, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 24, 2016

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

Searchable as RT130168$

@p6rt
Copy link
Author

p6rt commented Nov 24, 2016

From @japhb

See discussion starting at​:

  https://irclog.perlgeek.de/perl6-dev/2016-11-24#i_13623505

In short, if the interval is too short, the supply will stop progressing​:

06​:54 < jnthn> m​: react { whenever Supply.interval(.001) { .say; done
if $_ == 5 } }
06​:54 < camelia> rakudo-moar 1b840f​: OUTPUT«0␤1␤2␤3␤4␤5␤»
06​:54 < jnthn> m​: react { whenever Supply.interval(.0001) { .say; done
if $_ == 5 } }
06​:54 < camelia> rakudo-moar 1b840f​: OUTPUT«(timeout)0␤»
06​:54 < jnthn> Yup, that's decidedly wrong.

@p6rt
Copy link
Author

p6rt commented Nov 30, 2016

From @jnthn

On Thu, 24 Nov 2016 07​:01​:27 -0800, gjb@​google.com wrote​:

See discussion starting at​:

https://irclog.perlgeek.de/perl6-dev/2016-11-24#i_13623505

In short, if the interval is too short, the supply will stop progressing​:

06​:54 < jnthn> m​: react { whenever Supply.interval(.001) { .say; done
if $_ == 5 } }
06​:54 < camelia> rakudo-moar 1b840f​: OUTPUT«0␤1␤2␤3␤4␤5␤»
06​:54 < jnthn> m​: react { whenever Supply.interval(.0001) { .say; done
if $_ == 5 } }
06​:54 < camelia> rakudo-moar 1b840f​: OUTPUT«(timeout)0␤»
06​:54 < jnthn> Yup, that's decidedly wrong.

The minimum resolution supported is 1ms. We were thus doing something like ($secs * 1000).Int, which ended up as zero, which is also the value for the repeat interval that means "don't repeat". Thus it only ever spat out one value.

Now we round to 1ms in this case, and produce a warning that we don't support resolutions below that.

Test added for non-hanging on S17-supply/interval.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Nov 30, 2016

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

@p6rt
Copy link
Author

p6rt commented Nov 30, 2016

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

@p6rt p6rt closed this as completed Nov 30, 2016
@p6rt p6rt added the Bug 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