|
| 1 | +# 🐍 Python Async Programming Sessions |
| 2 | + |
| 3 | +A repository for exploring **asynchronous programming in Python**. This collection of examples demonstrates various concurrency models, ranging from simple synchronous HTTP requests to advanced async patterns using decorators, futures, and more. |
| 4 | + |
| 5 | +## What is Asynchronous Programming? |
| 6 | + |
| 7 | +Asynchronous programming enables you to write non-blocking, concurrent code using constructs like `async/await` and event loops. It is ideal for I/O-bound tasks and improves the performance of network and parallel operations without relying solely on multi-threading or multi-processing. |
| 8 | + |
| 9 | +## Key Imports & Modules |
| 10 | + |
| 11 | +These examples utilize several Python modules, including: |
| 12 | + |
| 13 | +- **Core Async Tools:** `asyncio` |
| 14 | +- **HTTP Clients:** `aiohttp`, `requests` |
| 15 | +- **Concurrency:** `threading`, `multiprocessing` |
| 16 | +- **Utilities:** `time`, `functools`, `os` |
| 17 | + |
| 18 | +## Examples Included |
| 19 | + |
| 20 | +- **Synchronous Requests:** |
| 21 | + Simple HTTP requests using the `requests` library. |
| 22 | + |
| 23 | +- **Threading & Multiprocessing:** |
| 24 | + Demonstrations of running tasks concurrently using threads and processes. |
| 25 | + |
| 26 | +- **Asyncio Basics:** |
| 27 | + Creating async functions, using `asyncio.sleep`, and managing tasks with the event loop. |
| 28 | + |
| 29 | +- **Advanced Async Techniques:** |
| 30 | + Handling timeouts, cancellation, and using custom decorators (e.g., for timing execution). |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +👤 **Author:** Piotr Lipinski |
| 35 | +🗓 **Date:** March 2025 |
| 36 | +💬 **Feedback:** Contributions and suggestions are welcome! |
0 commit comments