Skip to main content

aslooper

looper Used to cancel all running tasks after catching SIGINT, SIGTERM signals, Quit running without raise asyncio cancelled error.

use looper

import asyncio
from aslooper import looper


async def run(i):
    while True:
        print(f"{i} running.")
        await asyncio.sleep(1)


@looper()
async def main():
    tasks = [run(i) for i in range(3)]
    await asyncio.gather(*tasks)


asyncio.run(main())

run with a call

import asyncio
from aslooper import looper


async def run(i):
    while True:
        print(f"{i} running.")
        await asyncio.sleep(1)


def some_call():
    print("some_call")


@looper(some_call)
async def main():
    while True:
        print("run something.")
        await asyncio.sleep(1)


asyncio.run(main())

Metadata

Release files for aslooper 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aslooper 1.3.0
File Size Uploaded
aslooper-1.3.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aslooper 1.3.0
File Interpreter ABI Platform
aslooper-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / aslooper-1.3.0.tar.gz

Download URL aslooper-1.3.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f90f8036af2de907a2192537e5adcde4c72d943219be7f1d568d91e9122102db
BLAKE2b-256 checksum
How to use checksums
bf2b864388fb81705c7c4c5d1c3d6fa0ecc0bb1c8a6c504dc46aa54127eda897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Linux/6.8.11-amd64

Release files / aslooper-1.3.0-py3-none-any.whl

Download URL aslooper-1.3.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8bf7ab3794046cf8768eea881fecaee4e5cd1182adf3320af74a1341a1063f8
BLAKE2b-256 checksum
How to use checksums
7bb14f6ed10799cd51a90780cd638d8777d078a0e4c592b0754a480aef857e3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Linux/6.8.11-amd64

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.1

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.7

2 release files

1.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page