'how to match Websoket real time reponse with user request

Basically I have an problem that how i can match realtime Websoket response with user request whereas Websoket response is different and change every second either i have to compare it every time with database or after some interval if i do after some interval then how we can compare those responses who came during the interval because its realtime live application like stock market where every time change different companies share price

I hope you get my point if not and you think you can help me let me say to brief it

Thanks in advance!!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source