Extension for asynckivy programs
Project description
Queue
Extension for asynckivy
programs.
from kivy.app import App
import asynckivy as ak
from asynckivy_ext.queue import Queue
async def producer(q):
for c in "ABC":
await q.put(c)
print('produced', c)
q.half_close()
async def consumer(q):
async for c in q:
print('consumed', c)
q = Queue(capacity=1)
ak.start(producer(q))
ak.start(consumer(q))
App().run()
produced A
consumed A
produced B
consumed B
produced C
consumed C
The consumer()
above can be written in more primitive way:
from asynckivy_ext.queue import Closed
async def consumer(q):
try:
while True:
c = await q.get()
print('consumed', c)
except Closed:
pass
Installation
It's recommended to pin the minor version, because if it changed, it means some important breaking changes occurred.
poetry add asynckivy-ext-queue@~0.2
pip install "asynckivy-ext-queue>=0.2,<0.3"
Tested on
- CPython 3.9 + Kivy 2.2.1
- CPython 3.10 + Kivy 2.2.1
- CPython 3.11 + Kivy 2.2.1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for asynckivy_ext_queue-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40683f74b5e1187d808381a89afb059ca2e3b5a00def104dae0b6fad73be35cd |
|
MD5 | f94c6bb4c50312537cdea1e48af44436 |
|
BLAKE2b-256 | aea5c8d248ebec67b174bcacfe40fa32cdc796b28932876f7c0d3468b4fa0d92 |
Close
Hashes for asynckivy_ext_queue-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf890d58fb23bb06d4a0bc365abd869f0f8a66968fb69469804ce408ebfc7fe0 |
|
MD5 | 8a45320ec2373315c67f327d9df9fc8c |
|
BLAKE2b-256 | 574346ea868185f430ad12ef9470e6202859d3df7005a03a66847e007bedcbbc |