Skip to content

tadzik/Coroutines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Holy raptors, look at this code!

    use Coroutines;
    
    async {
        # some asynchronous thread of execution
        say 2;
        yield; # yield back to main
        say 4;
    };
    
    say 1;
    schedule; # jump to async block
    say 3;
    schedule; # and again
    say 5;
    schedule; # this would do nothing, all coroutines are exhausted
    say 6;

This will print 1, 2, 3, 4, 5, 6! In the correct order!
Awesome!
Order NOW for 1.99zł!

About

The only fake threads in Perl 6

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%