Skip to content

Latest commit

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Jellopy jellopy - Ruby async/await syntax

Build

gem install jellopy

Inspired by Python 3.5 (PEP-0492)

Note that await has to be used only in functions with the async keyword.

require'jellopy'
$eloop =EventLoop.newasyncdeftest1puts'test1 before sleep'asleep10puts'test1 after sleep'endasyncdeftest3puts'test3 before sleep'asleep2puts'test3 after sleep'endasyncdeftest2puts'test2 before await'await(test1)puts'test2 after await'end
$eloop.create_task(test2)
$eloop.create_task(test3)
$eloop.start

Output:

test2 before await
test3 before sleep
test1 before sleep
test3 after sleep
test1 after sleep
test2 after await

Releases

Packages

Contributors

Languages