Current collected state Current
Observed since 20 Oct, 17:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Python batch task pool with asyncio support
An asynchronous batch processing engine for Python.
pip install abatchtaskpool
from typing import Any, List
import asyncio
from abatchtaskpool.async_batch_engine import AsyncBatchEngine
async def example_processing_function(inputs: List[Any]) -> List[Any]:
"""示例批处理函数"""
await asyncio.sleep(1) # 模拟处理耗时
return [f"Processed_{item}" for item in inputs]
async def main():
# 创建引擎实例
engine = AsyncBatchEngine(
processing_function=example_processing_function,
batch_size=5,
wait_timeout=0.5,
num_workers=2
)
# 提交任务并获取结果
tasks = [
engine.add_request(f"task_{i}", f"req_{i}")
for i in range(10)
]
results = await asyncio.gather(*tasks)
# 输出结果
for result in results:
print(f"Result: {result}")
# 停止引擎
await engine.stop()
if __name__ == "__main__":
asyncio.run(main())
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 7 Apr 2025 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:ec60539b55c88c71004e69ca253f82ea31bd6facc3e40a656c30ca159c7c6229