0
votes

Using nodejs and redis sub/pub system. When I log into my web app I want to get the latest published content once I subscribe to it via nodejs. Is this possible? When I login I want the user to see the content from the channel they subscribed to. Right now when I login there is no data, but when I publish content to the channel it shows up, I refresh the page and the content does not show again.

EDIT

When the person logs into the system would I instead just load the results from the db via php then from there subscribe to the channel via nodejs and update the rows via redis sub/pub? Is that how it would work?

1

1 Answers

0
votes

I think the best answer is anytime data is published to the channel to at the same time store that data in redis using the channel name as the key. Then when a user logs in it then grabs that data in redis, displays it then subscribe to the channel waiting for updated information. Do you agree or is there a better way?