Skip to content

ricksanchezlabs/async-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

async-task

Distributed and scheduled tasks with Redis Pub/Sub

  • Create a container and define the tasks:
import asyncio
from async_task import TaskManager

manager = TaskManager()


@manager.register
async def task(name: str):
    print(f'Hello {name}')


if __name__ == '__main__':
    asyncio.run(manager.run())
  • Publish a message in the channel:
PUBLISH default '{"task":"task", "args": ["Chess"]}'
  • The task will produce the output:
Hello Chess

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages