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

await handles Slip differently between v6.c and v6.d.PREVIEW #6521

Closed
p6rt opened this issue Sep 14, 2017 · 4 comments
Closed

await handles Slip differently between v6.c and v6.d.PREVIEW #6521

p6rt opened this issue Sep 14, 2017 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Sep 14, 2017

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

Searchable as RT132091$

@p6rt
Copy link
Author

p6rt commented Sep 14, 2017

From @timo

I'm using two start blocks that return Slips to generate a long list in
parallel, then i iterate over the result in the Moar Heap Analyzer.

Trying to take advantage of v6.d's nonblocking await gives me a change
in semantics, though​:

    use v6.d.PREVIEW;
    use Test;
    my @​foo = do {
        await start { do for ^2 { my uint64 @​ = 9, 9; }.Slip },
              start { do for ^2 { my uint64 @​ = 1, 2; }.Slip };
    };
    is @​foo.elems, 4, "slips awaited over get flattened out";
    say @​foo.perl

    # -> not ok 1 - slips awaited over get flattened out
    # -> [slip(array[uint64].new(9, 9), array[uint64].new(9, 9)),
slip(array[uint64].new(1, 2), array[uint64].new(1, 2))]

    use Test;
    my @​foo = do {
        await start { do for ^2 { my uint64 @​ = 9, 9; }.Slip },
              start { do for ^2 { my uint64 @​ = 1, 2; }.Slip };
    };
    is @​foo.elems, 4, "slips awaited over get flattened out";
    say @​foo.perl

    # -> ok 1 - slips awaited over get flattened out
    # -> [array[uint64].new(9, 9), array[uint64].new(9, 9),
array[uint64].new(1, 2), array[uint64].new(1, 2)]

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

From @jnthn

On Thu, 14 Sep 2017 13​:30​:46 -0700, timo wrote​:

I'm using two start blocks that return Slips to generate a long list in
parallel, then i iterate over the result in the Moar Heap Analyzer.

Trying to take advantage of v6.d's nonblocking await gives me a change
in semantics, though​:

    use v6.d.PREVIEW;
    use Test;
    my @​foo = do {
        await start { do for ^2 { my uint64 @​ = 9, 9; }.Slip },
              start { do for ^2 { my uint64 @​ = 1, 2; }.Slip };
    };
    is @​foo.elems, 4, "slips awaited over get flattened out";
    say @​foo.perl

    # -> not ok 1 - slips awaited over get flattened out
    # -> [slip(array[uint64].new(9, 9), array[uint64].new(9, 9)),
slip(array[uint64].new(1, 2), array[uint64].new(1, 2))]

    use Test;
    my @​foo = do {
        await start { do for ^2 { my uint64 @​ = 9, 9; }.Slip },
              start { do for ^2 { my uint64 @​ = 1, 2; }.Slip };
    };
    is @​foo.elems, 4, "slips awaited over get flattened out";
    say @​foo.perl

    # -> ok 1 - slips awaited over get flattened out
    # -> [array[uint64].new(9, 9), array[uint64].new(9, 9),
array[uint64].new(1, 2), array[uint64].new(1, 2)]

Fixed, and test coverage in S17-promise/nonblocking-await.t.

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

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

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

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

@p6rt p6rt closed this as completed Sep 15, 2017
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