Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Event loop lock detector for Python.


Installation

pip install gadasyncblock

Usage

import contextlib

from fastapi import FastAPI

from gadasyncblock import AsyncBlock
# logger: asyncio.detector

detector = AsyncBlock(timeout=1)

@contextlib.asynccontextmanager
async def lifespan(_: FastAPI):
    detector.start()
    yield
    detector.shutdown()


app = FastAPI(lifespan=lifespan)

@app.post("/run")
async def run():
    time.sleep(2)
    return {"message": "Blocked"}

About

Event loop lock detector for Python

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages