Skip to content
/ asyncz Public

Utility wrapper that makes asynchronous in Python more simple.

Notifications You must be signed in to change notification settings

BLeAm/asyncz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

asyncz

Utility wrapper that makes asynchronous in Python more simple.

from asyncio import sleep
from asyncz import mainz


async def timer(sec: int) -> int:
    await sleep(sec)
    return sec


async def printAfter(sec: int, text: str) -> None:
    await sleep(sec)
    print(text)


@mainz
async def main() -> None:
    printAfter(1, 'first try.')
    print('something')
    printAfter(3, 'second try.')
    print('value from await timer:', await timer(1))
    print(f'print after "{await timer(3)}" secs')
    print(f'print after "{await timer(2)}" secs')

if __name__ == '__main__':
    main()

result:

something
first try.
value from await timer: 1
second try.
print after "3" secs
print after "2" secs

About

Utility wrapper that makes asynchronous in Python more simple.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages