Skip to content

Commit

Permalink
feat(docs): removed dependencies docstring and added module level exa…
Browse files Browse the repository at this point in the history
…mple in intro docstring
  • Loading branch information
nvy-0x committed Sep 20, 2024
1 parent d79d1fd commit 6775809
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions a_sync/primitives/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
- Task processing with customizable worker counts
- Dynamic priority updates for tasks
Dependencies:
- asyncio: For asynchronous task and event management.
- weakref: To manage weak references for asynchronous futures.
- heapq: For implementing priority-based queueing.
- toolcache: Internal caching mechanism from the :mod:`~a_sync` library.
Example usage:
>>> from a_sync.primitives.queue import Queue, ProcessingQueue
>>> queue, proc_queue = Queue(), ProcessingQueue(func=str.upper, num_workers=2)
>>> await queue.put(item='task1')
>>> print(await queue.get())
task1
>>> print(await (await proc_queue.put(item='hello')))
HELLO
"""

import asyncio
Expand Down

0 comments on commit 6775809

Please sign in to comment.