Use WebSocket events instead of callbacks