Skip to main content

async_armor

info:

Graceful drop-in replacement for asyncio.shield

https://img.shields.io/travis/wikibusiness/async_armor.svg https://img.shields.io/pypi/v/async_armor.svg

Installation

pip install async_armor

Usage

import asyncio

from async_armor import armor

calls = 0

async def call_shield():
    global calls
    await asyncio.sleep(1)
    calls += 1

@armor
async def call_deco():
    global calls
    await asyncio.sleep(1)
    calls += 1

async def main():
    task = armor(call_shield())
    task.cancel()

    task = asyncio.ensure_future(call_deco())
    task.cancel()

loop = asyncio.get_event_loop()

loop.run_until_complete(main())

armor.close()
loop.run_until_complete(armor.wait_closed())

assert calls == 2

loop.close()

Python 3.3+ is required

Metadata

Release files for async_armor 0.0.2

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

Source distribution (sdist)

Source distribution for async_armor 0.0.2
File Size Uploaded Provenance Actions
async_armor-0.0.2.tar.gz 4.5 kB Without provenance Details for async_armor-0.0.2.tar.gz

Release files / async_armor-0.0.2.tar.gz

Download URL async_armor-0.0.2.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
db45d2646ecd98508b93853c8cb9d385274035ce15d77c76c6509b6750f9b829
BLAKE2b-256 checksum
How to use checksums
74446f423606a4c08b6def59aef74073209669ba011de040fa0932be1fb85c7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for async_armor 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

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