Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Queue
✓ from culsans import Queue
✗ from culsans.queue import Queue
Queue is directly exposed at the package level, not in a submodule.
QueueShutDown
✓ from culsans import QueueShutDown
✗ from culsans.exceptions import QueueShutDown
Exception classes are exported from the top-level package.
Grouper
✓ from culsans import Grouper
Introduced in 0.11.0; ensure version >= 0.11.0.
RWLock
✓ from culsans import RWLock
Introduced in 0.11.0; ensure version >= 0.11.0.
Basic async producer-consumer example using Culsans Queue.
import asyncio
from culsans import Queue
async def producer(queue):
for i in range(5):
await queue.put(i)
print(f'Produced {i}')
async def consumer(queue):
while True:
item = await queue.get()
if item is None:
break
print(f'Consumed {item}')
queue.task_done()
async def main():
queue = Queue()
prod = asyncio.create_task(producer(queue))
cons = asyncio.create_task(consumer(queue))
await prod
await queue.put(None) # sentinel
await cons
asyncio.run(main())
Debug
Known issues
breakingIn version 0.9.0, checkpoint functions are now called before queue operations instead of after. This may increase the number of explicit context switches, affecting performance or behavior in tight loops.fixIf you rely on checkpoint timing, review your code for any assumptions about when checkpoints are called. Consider using synchronous methods if context switches are costly.
affects: >=0.9.0
deprecatedPython 3.8 support was added in 0.8.0, but Python 3.8 is itself end-of-life. Future versions may drop Python 3.8 support.fixUpgrade to Python 3.9+ to ensure compatibility with future releases.
affects: >=0.8.0, <0.12.0
gotchaQueueShutDown is raised on various operations after close() or shutdown(), consistent with Python 3.13's queue shutdown. However, on Python <3.13, the exception is backported and may cause name conflicts with type checkers.fixUse 'from culsans import QueueShutDown' to ensure compatibility across Python versions; avoid importing from the stdlib's asyncio.queues.
affects: <3.13
gotchaMixedQueue is a protocol, not a concrete class. Do not instantiate MixedQueue directly.fixUse MixedQueue only for type annotations; use Queue, LifoQueue, PriorityQueue, etc. for instantiation.
affects: >=0.8.0
Errors
Common errors & fixes
from culsans.queue import Queue
ModuleNotFoundError: No module named 'culsans.queue'
Queue is not in a submodule; it is directly exported from the top-level package.
fixUse 'from culsans import Queue'
AttributeError: module 'culsans' has no attribute 'LifoQueue'
LifoQueue was removed in version 0.7.0 in favor of general Queue with an optional 'maxsize' parameter and 'type' argument? Actually, LifoQueue is still present, but this error may occur if using an old version or incorrect import path.
fixEnsure you have installed culsans >=0.7.0. Use 'from culsans import LifoQueue' if you need LIFO behavior.
Upgrade
Version history
0.11.0latest on PyPI · released Dec 31, 2025
Audit
Dependencies
aiologicrequiredCore dependency for lock-free async primitives