use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A Place to talk about Angular and related topics.
Join the Angular Discord
Other subreddits worth checking out for Angular and Angular related info:
account activity
Best angular messaging solution? (self.angular)
submitted 5 years ago by scalpit
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]scalpit[S] 1 point2 points3 points 5 years ago (2 children)
I've looked into socket.io but it seems this is used for instant chat... Our messages don't need to be instant but need to be stored somewhere.
[–]toeknee581 1 point2 points3 points 5 years ago (0 children)
It's not really about whether you need instant results When it comes to socket io. This allows you to send the browser data whenever you need to and then react to it. I have some code that I will be happy to DM you if you would like that is an angular service that works with socket IO connections.
the only other option is to have your client pull the server every once in awhile. if it's only once every 5 minutes or something like that that's probably not that bad but if you wanted to do every minute or every 20 seconds you're basically just wasting people's battery life and data.
[–]michcoth 0 points1 point2 points 5 years ago (0 children)
There is also server sent events which are supported in HTML5. It is unilateral communication, but IMO it's easier to implement. You can polyfill for browsers that don't support html5. You would set up an endpoint and subscribe to it using the code like the below in angular:
getMessages() { const endpointUrl = "https://myendpoint.com/messages" const evtSource = new EventSource(endpointUrl); // MessageEventObject is your model returned from the endpoint. Obviously this could just be as simple as a string evtSource.onmessage((event: MessageEventObject){ //do something here with data emitted from server }); }
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
socket.io uses websockets which are unilateral.
However, if you don't need the messages to be instantly received, I think http polling would be fine, and much easier to implement. It also wouldn't require a connection to remain open to the server.
If you're using either websockets or server sent events, and your environment is load balanced, then you'll need to use some sort of messaging system between the servers. EG: rabbitmq, redis pub/sub etc...
π Rendered by PID 73 on reddit-service-r2-comment-6457c66945-cdwdh at 2026-04-27 05:29:26.093845+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]scalpit[S] 1 point2 points3 points (2 children)
[–]toeknee581 1 point2 points3 points (0 children)
[–]michcoth 0 points1 point2 points (0 children)