All Projects → hellysmile → async_armor

hellysmile / async_armor

Licence: MIT license
Graceful drop-in replacement for asyncio.shield

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to async armor

thanker
Don't be a wanker, be a thanker! Automatically give thanks to Pypi packages you use in your project.
Stars: ✭ 25 (+66.67%)
Mutual labels:  asyncio
python-logi-circle
Python 3.6+ API for Logi Circle cameras
Stars: ✭ 23 (+53.33%)
Mutual labels:  asyncio
pydf
PDF generation in python using wkhtmltopdf for heroku and docker
Stars: ✭ 68 (+353.33%)
Mutual labels:  asyncio
triviaroyale
Trivia game in the browser using websockets and asyncio.
Stars: ✭ 13 (-13.33%)
Mutual labels:  asyncio
python-socks
Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python
Stars: ✭ 40 (+166.67%)
Mutual labels:  asyncio
python3-concurrency
Python3爬虫系列的理论验证,首先研究I/O模型,分别用Python实现了blocking I/O、nonblocking I/O、I/O multiplexing各模型下的TCP服务端和客户端。然后,研究同步I/O操作(依序下载、多进程并发、多线程并发)和异步I/O(asyncio)之间的效率差别
Stars: ✭ 49 (+226.67%)
Mutual labels:  asyncio
eventkit
Event-driven data pipelines
Stars: ✭ 94 (+526.67%)
Mutual labels:  asyncio
py3tftp
An asynchronous TFTP server in pure Python 3.5
Stars: ✭ 39 (+160%)
Mutual labels:  asyncio
duckpy
A simple Python library for searching on DuckDuckGo.
Stars: ✭ 20 (+33.33%)
Mutual labels:  asyncio
tomodachi
💻 Microservice library / framework using Python's asyncio event loop with full support for HTTP + WebSockets, AWS SNS+SQS, RabbitMQ / AMQP, middleware, etc. Extendable for GraphQL, protobuf, gRPC, among other technologies.
Stars: ✭ 170 (+1033.33%)
Mutual labels:  asyncio
hikari
A Discord API wrapper for Python and asyncio built on good intentions.
Stars: ✭ 631 (+4106.67%)
Mutual labels:  asyncio
bolsa
Biblioteca feita em Python com o objetivo de facilitar o acesso a dados de seus investimentos na bolsa de valores(B3/CEI) através do Portal CEI.
Stars: ✭ 46 (+206.67%)
Mutual labels:  asyncio
pyaiot
A set of Python services to interact and transport data from IoT devices
Stars: ✭ 29 (+93.33%)
Mutual labels:  asyncio
timvt
PostGIS based Vector Tile server.
Stars: ✭ 113 (+653.33%)
Mutual labels:  asyncio
spinach
Modern Redis task queue for Python 3
Stars: ✭ 46 (+206.67%)
Mutual labels:  asyncio
HibiAPI
一个实现了多种常用站点的易用化API的程序 / A program that implements easy-to-use APIs for a variety of commonly used sites.
Stars: ✭ 427 (+2746.67%)
Mutual labels:  asyncio
aiosc
Lightweight Open Sound Control implementation for Python using asyncio
Stars: ✭ 26 (+73.33%)
Mutual labels:  asyncio
callosum
An RPC Transport Library for asyncio
Stars: ✭ 17 (+13.33%)
Mutual labels:  asyncio
waspy
WASP framework for Python
Stars: ✭ 43 (+186.67%)
Mutual labels:  asyncio
asyncio-throttle
Simple, easy-to-use throttler for asyncio.
Stars: ✭ 95 (+533.33%)
Mutual labels:  asyncio

async_armor

info:Graceful drop-in replacement for asyncio.shield

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].