ASGI? WSGI?

This is what a FastAPI app using Gunicorn managing Uvicorn workers may look like in a nutshell: Web Server vs Application Server vs Web Client Web servers are especially good at serving static content, they are also good at caching, load balancing, and doing reverse proxy. Apache and Nginx are common web servers. Application servers are designed to run application code, they are good at handling dynamic content, and they can run multiple languages....

April 29, 2024 · 2 min

AioHttp 取代 Requests

1 2 3 4 5 6 7 8 9 10 11 async def main(): async with aiohttp.ClientSession() as session: collected_data = [] depth = 0 max_depth = os.getenv('MAX_DEPTH') INITIAL_ADDRESSES = [#some addresses here] tasks = [process_transactions(session, address, API_KEY, depth, max_depth, collected_data) for address in INITIAL_ADDRESSES] await asyncio.gather(*tasks) save_to_csv(collected_data)

November 17, 2023 · 1 min