Given a stream of sensor data from ASML equipment, write a function to efficiently compute the moving median over a sliding window.