Skip to content

Instantly share code, notes, and snippets.

View mhrlife's full-sized avatar
😁
Learning Go

Mohammad hoseini rad mhrlife

😁
Learning Go
View GitHub Profile
import asyncio
import time
import aiohttp
import requests
from typing import List, Callable
def get_user_info(user_id: int) -> dict | None:
response = requests.get(f"http://127.0.0.1:8000/user/{user_id}").json()
if 'ok' not in response or not response['ok']:
import asyncio
from fastapi import FastAPI, Depends
from starlette.websockets import WebSocket
import redis.asyncio as redis
app = FastAPI()
redis_connection_pool = redis.ConnectionPool(
host='...',