This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from faststream import FastStream | |
from faststream.redis import RedisBroker, RedisMessage, StreamSub | |
broker = RedisBroker() | |
app = FastStream(broker) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from opentelemetry.sdk.resources import Resource | |
from opentelemetry.sdk.trace import TracerProvider | |
from opentelemetry.sdk.trace.export import BatchSpanProcessor | |
from faststream.redis import RedisMessage | |
from faststream.redis.fastapi import RedisRouter | |
from faststream.redis.opentelemetry import RedisTelemetryMiddleware | |
router = RedisRouter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from opentelemetry import trace | |
from opentelemetry.context import Context | |
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter | |
from opentelemetry.sdk.resources import Resource | |
from opentelemetry.sdk.trace import TracerProvider | |
from opentelemetry.sdk.trace.export import BatchSpanProcessor | |
from opentelemetry.trace import Link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from functools import wraps | |
from typing import Any, Callable, ParamSpec, TypeVar, cast, overload | |
F_Spec = ParamSpec("F_Spec") | |
F_Return = TypeVar("F_Return") | |
Func = Callable[F_Spec, F_Return] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import anyio | |
from fastapi import Depends, FastAPI | |
app = FastAPI() | |
def sync_dependency_one() -> str: | |
time.sleep(0.00000001) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import hmac | |
import json | |
from dataclasses import dataclass | |
from operator import itemgetter | |
from typing import Any | |
from urllib.parse import parse_qsl | |
@dataclass(eq=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ssl | |
from types import TracebackType | |
from typing import Any, Type | |
import certifi | |
from aiohttp import ClientSession, TCPConnector, ClientTimeout, ClientResponse | |
from aiohttp.typedefs import StrOrURL | |
from aiohttp import ClientResponseError | |
Headers = dict[str, str] | None |