
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
async-queue-manager
is a Python library designed to manage and execute tasks concurrently using asyncio.
It supports task prioritization, robust error handling, and efficient queue management for both finite
and infinite task processing modes.
QueueItem:
TaskQueue:
finite
: Process tasks and stop.infinite
: Continuously process tasks until stopped.Ensure you have Python 3.10+ installed.
pip install async-queue-manager
import asyncio
from async_queue.task_queue import TaskQueue
from async_queue.queue_item import QueueItem
async def my_task(name, duration):
print(f"{name} is starting...")
await asyncio.sleep(duration)
print(f"{name} is finished.")
async def main():
queue = TaskQueue(workers=3, mode='finite')
# Add tasks
for i in range(5):
task = QueueItem(my_task, name=f"Task-{i}", duration=2)
queue.add(item=task, priority=i)
# Run the queue
await queue.run(queue_timeout=10)
# Run the program
asyncio.run(main())
queue_item.py
: Implements the QueueItem
class.task_queue.py
: Contains the TaskQueue
class for task management.Contributions are welcome!
This project is licensed under the MIT License. See the LICENSE file for details.
See the documentation for more details.
FAQs
Asynchronous Task Queue
We found that async-queue-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.