socket.io-redux | Redux middleware to emit action via socket.io | Socket library
kandi X-RAY | socket.io-redux Summary
kandi X-RAY | socket.io-redux Summary
Redux middleware to emit action via socket.io
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of socket.io-redux
socket.io-redux Key Features
socket.io-redux Examples and Code Snippets
Community Discussions
Trending Discussions on socket.io-redux
QUESTION
This might be a dumb question, but I am trying to explain it as simply as I can.
So I have been using axios to retrieve data from my server to my react app (redux) Since I use socket.io in my app a lot, I thought I could make the authentication use that as well, so I don't have to use axios and socket.io concurrently. I have been using PassportJS for authentication, but I can't wrap my head around how the socket.io passport packages I found on npm work.
I am using this socket.io-redux middleware to fire reducers on socket.io events. With this, I can dispatch actions that then get sent to the server, and from the server I can fire the reducers I want, in order to change the state.
Here is my store.js
...ANSWER
Answered 2020-Nov-09 at 10:23I have done the exact same thing in a previous project that I worked, saved in an array the mongo and socket id-s of each user.
Think of it this way, how much memory will one of these objects take, about 50 bytes maybe? 60? So technically you can have ~10 million of these in memory, assuming with a maximum usage of 500 MB of memory. The Node maximum memory limit goes from 700MB to 1.4GB between 32 and 64 bit systems, so with 10 million socket instances (which are not the same as 10 million simultaneous users since a user can have more than one tab open, and one socket is created for each tab/instance) you should be safe, since Node itself is assumed to not be used for intensive operations.
Now these are the limits, and in the end, you still can stretch beyond this limit by using some Redis or Memcache to be sort of in between memory and storage speed, and since I don't know your scenario I assume that you are pretty safe in terms of leaks if you correctly cleanup the logged out users.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install socket.io-redux
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page