Settings

Theme

Show HN: FastAPI Realtime Stock Monitor with Python worker threads [video]

youtube.com

3 points by san_tekart a year ago · 3 comments · 1 min read

Reader

Show HN: FastAPI Realtime Stock Monitor with Python worker threads

I built a real-time stock monitoring demo that simulates market data streams to show how to handle multiple real-time updates in Python without complex dependencies like Celery.

Key concepts: - Worker threads for background processing - Event-driven architecture with emitter-listener pattern - WebSocket for real-time updates - Clean separation of concerns

The application uses PynneX (a lightweight Python library) to implement: 1. Signal/slot pattern for event handling 2. Worker thread management 3. Thread-safe task queuing

Technical stack: - FastAPI for the web framework - WebSocket for real-time communication - ag-Grid for interactive data display - eCharts for candlestick visualization

No message brokers, no task queues, no complex setup - just Python's built-in threading and asyncio with a thin event-driven layer.

Quick start:

pip install pynnex fastapi python-socketio uvicorn python examples/fastapi_socketio_stock_monitor.py

Then open http://localhost:8000

Code: https://github.com/nexconnectio/pynnex/blob/main/examples/fa...

pvg a year ago

You're better off showhning the thing itself, like here https://news.ycombinator.com/item?id=42559726 rather than an example/demo of it and linking the github repo as your main submission. You could include the example and link to the video in your blurb.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection