1️⃣ await asyncio.gather(*tasks)만 사용하는 경우레스토랑의 요리사들이 각 요리를 준비하고 모든 요리가 다 완성된 후 한꺼번에 손님에게 서빙한다. 메뉴: 샐러드, 파스타, 스테이크import asyncioimport timeasync def prepare_dish(dish): print(f"Starting to prepare {dish}...") await asyncio.sleep(2) # 준비 시간 print(f"{dish} is ready!") return f"{dish} is ready!"async def main(): # 메뉴 주문 orders = ["Salad", "Pasta", "Steak"] tasks = [prepare_dish..
🍲 await: 웨이터가 요리가 나올 때까지 기다리기웨이터가 요리를 기다리는 것처럼, await는 비동기 작업이 완료될 때까지 실행을 일시 중단함import asyncioasync def prepare_dish(dish_name): print(f"{dish_name} 준비 중...") await asyncio.sleep(2) # 요리 시간 대기 print(f"{dish_name} 완성!")async def serve_order(): await prepare_dish("파스타") # 파스타가 완성될 때까지 대기asyncio.run(serve_order()) 🍽️ asyncio.create_task: 여러 주문 동시에 처리하기바쁜 레스토랑에서 웨이터는 여러 주문을 동시에 받을 수..
- Total
- Today
- Yesterday
- asyncio.gather
- supervised
- ADT
- un-supervised
- window
- 비동기
- SSR
- nextj이미지저장
- Tailwind
- semi-supervised
- Python
- next.js
- 함수형프로그래밍
- 42서울
- 윈도우pscale설치
- CloudFlare
- iris
- 위즈윅에디터
- datalabeling
- k8s
- nodejs
- kubectl
- 대수자료구조
- create_task
- asyncio
- planetscale배포
- pscale
- helm
- 우테코
- 타입스크립트
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |