Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: FastAPI Realtime Stock Monitor with Python worker threads [video] (youtube.com)
3 points by san_tekart 2 days ago | hide | past | favorite | 2 comments
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...






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.

Thanks for the advice! You're right - I'll repost.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: