I have read a number of articles describing how websockets and pub sub architectures work at a high level.
I get that with websockets a connection is persisted between a client and a server to send and receive messages bidirectionally.
I also understand that with a pub-sub architecture, a sub can subscribe to a topic and receive messages that a pub publishes to that topic.
However, how does a subscriber or in the case of a websocket connection the server/client know when a new message is received? Are the server and client constantly checking for new messages using something like short polling over that connection? Does a subscriber constantly poll the topic? I haven't found a resource yet that explains this underlying functionality and how it works.