Skip to main content

Simple tool for run asyncio tasks periodically.

Project description

# periodic

Simple tool for run asyncio tasks periodically.

# Setup

```bash
pip install asyncio-periodic
```


# Example usage

```python
import asyncio
from datetime import datetime

from periodic import Periodic


async def periodically(param):
print(datetime.now(), 'Yay!', param)
await asyncio.sleep(1)
print(datetime.now(), 'Done!')

async def main():
p = Periodic(3, periodically, 'Periodically!')
await p.start()

if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.create_task(main())
loop.run_forever()
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asyncio-periodic-2019.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

asyncio_periodic-2019.2-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page