ranaroussi/multitasking được TopGit xếp vào nhóm dự án backend, với 233 sao trên GitHub, viết chủ yếu bằng Python. Non-blocking Python methods using decorators
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
MultiTasking: Non-blocking Python methods using decorators
|Python version| |PyPi version| |PyPi status| |PyPi downloads|
|CodeFactor| |Star this repo| |Follow me on twitter|
MultiTasking is a lightweight Python library that lets you convert
your Python methods into asynchronous, non-blocking methods simply by
using a decorator. Perfect for I/O-bound tasks, API calls, web scraping,
and any scenario where you want to run multiple operations concurrently
without the complexity of manual thread or process management.
✨ What’s New in v0.0.12
🎯 Full Type Hint Support: Complete type annotations for better
IDE support and code safety
📚 Enhanced Documentation: Comprehensive docstrings and inline
comments for better maintainability
🔧 Improved Error Handling: More robust exception handling with
specific error types
🚀 Better Performance: Optimized task creation and management
logic
@multitasking.task # <== this is all it takes! 🎉
def hello(count):
sleep_time = random.randint(1, 10) / 2
print(f"Hello {count} (sleeping for {sleep_time}s)")
time.sleep(sleep_time)
print(f"Goodbye {count} (slept for {sleep_time}s)")
if name == "main":
# Launch 10 concurrent tasks
for i in range(10):
hello(i + 1)
# Wait for all tasks to complete
multitasking.wait_for_tasks()
print("All tasks completed!")
Output:
.. code:: bash
$ python example.py
Hello 1 (sleeping for 0.5s)
Hello 2 (sleeping for 1.0s)
Hello 3 (sleeping for 5.0s)
Hello 4 (sleeping for 0.5s)
Hello 5 (sleeping for 2.5s)
Hello 6 (sleeping for 3.0s)
Hello 7 (sleeping for 0.5s)
Hello 8 (sleeping for 4.0s)
Hello 9 (sleeping for 3.0s)
Hello 10 (sleeping for 1.0s)
Goodbye 1 (slept for 0.5s)
Goodbye 4 (slept for 0.5s)
Goodbye 7 (slept for 0.5s)
Goodbye 2 (slept for 1.0s)
Goodbye 10 (slept for 1.0s)
Goodbye 5 (slept for 2.5s)
Goodbye 6 (slept for 3.0s)
Goodbye 9 (slept for 3.0s)
Goodbye 8 (slept for 4.0s)
Goodbye 3 (slept for 5.0s)
All tasks completed!
Environments: Works in Jupyter notebooks, scripts, web
applications
Frameworks: Compatible with Flask, Django, FastAPI, and other
Python frameworks
API Reference
Decorators
@multitasking.task - Convert function to asynchronous task
Configuration Functions
set_max_threads(count) - Set maximum concurrent tasks
set_engine(type) - Choose “thread” or “process” engine
createPool(name, threads, engine) - Create custom execution pool
Task Management
wait_for_tasks(sleep=0) - Wait for all tasks to complete
get_active_tasks() - Get list of running tasks
get_list_of_tasks() - Get list of all tasks
killall() - Emergency shutdown (force exit)
.. _pool-management-1:
Pool Management
getPool(name=None) - Get pool information
createPool(name, threads=None, engine=None) - Create new pool
Performance Benchmarks
Here’s a simple benchmark comparing synchronous vs asynchronous
execution:
.. code:: python
import multitasking
import time
import requests
Synchronous version
def sync_fetch():
start = time.time()
for i in range(10):
requests.get("https://httpbin.org/delay/1")
print(f"Synchronous: {time.time() - start:.2f}s")
def concurrent_fetch():
start = time.time()
for i in range(10):
async_fetch()
multitasking.wait_for_tasks()
print(f"Concurrent: {time.time() - start:.2f}s")
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/ranaroussi/multitasking là nguồn chính thức.
ranaroussi/multitasking có bao nhiêu sao?
ranaroussi/multitasking có 233 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/ranaroussi/multitasking. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
ranaroussi/multitasking có phải mã nguồn mở không?
Có — ranaroussi/multitasking phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/ranaroussi/multitasking.
ranaroussi/multitasking còn đang phát triển không?
Commit gần nhất trên ranaroussi/multitasking là 7 tháng trước (theo timestamp GitHub). Repo có 47 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
ranaroussi/multitasking là gì?
ranaroussi/multitasking (ranaroussi/multitasking) là dự án Python trên GitHub. Theo mô tả gốc: Non-blocking Python methods using decorators
ranaroussi/multitasking so với các dự án Backend khác thế nào?
ranaroussi/multitasking được TopGit xếp vào nhóm Backend, với 233 sao GitHub và viết bằng Python. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về multitasking?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về multitasking.