-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observing every post on its own: is it effective? #2
Comments
I did not get what you actually mean. But AFAIK, there is no observer added every post. What is happening when a user follows is that, all the posts of the followed user will be copied/put into the feed of the logged in user. |
To understand what you mean, a code snippet could help. |
In
You are chaining observers. For every post you have 3 additional observers. If there are 100 posts in your stream, this means that you will have at least 400 observers. Isn't this too much? See this related SO question: |
@MHX792 Yep, I already got your point. This function will produce a large amount of observers. I guess the implementation of post pagination using the |
But fetching only 10 posts is way to insufficient. It should show at least the latest 50 posts which would result in having 200 observers. Isn't there any other way to do this? |
I think there is way. You can implement by having a queue. |
I just looked through your code and saw that you add an observer for every post in the user's stream. When a user follows 100 other users who posted like 10 pics each, this means you will need to have 1000 observers.
Is this really a good approach?
The text was updated successfully, but these errors were encountered: