/ justapi / tests / test_loop_alive.py
swadhinbiswas test: add end-to-end integration test suite with gRPC and proto stubs · 7/9/2026
43e015f
22 lines · 415 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from justapi import JustAPIApp
import asyncio, threading

app = JustAPIApp()

async def hello(req):
    await asyncio.sleep(0.01)
    return {"message": "hello"}

app.get("/", hello)

def monitor():
    import time
    while True:
        time.sleep(1)
        print("Threads:", threading.enumerate())

threading.Thread(target=monitor, daemon=True).start()

if __name__ == "__main__":
    app.run("127.0.0.1:8080")