Skip to content
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

Group feeds? #8

Closed
archonic opened this issue Oct 29, 2018 · 1 comment
Closed

Group feeds? #8

archonic opened this issue Oct 29, 2018 · 1 comment

Comments

@archonic
Copy link

archonic commented Oct 29, 2018

On the "What is an activity feed?" wiki it mentions a feed is "personalized for a given user or a group, or global". Are group-based feeds supported by simple-feed?

In my requirements, I have account-based feeds and resource-based feeds. Both Accounts and Groups can be created by users and each should have their own scoped feed. I'm wondering where and how I should be instantiating those feeds.

I've got the gem talking with Redis by placing the SimpleFeed.define example into an initializer, but I believe I should have a migration to create the feeds for existing accounts and then an after_create action for creating new feeds for new accounts. Would something like SimpleFeed.feed(:account_feed).activity(@account.id)be enough to scope a feed to an account?

@archonic
Copy link
Author

Figured it out. Groups can just be a different feed.

SimpleFeed.define(:group_1) do |f|
  f.provider = SimpleFeed.provider(
    :redis,
    redis: -> { Redis.new(url: SIMPLEFEED_URL) },
    pool_size: 10
  )
  f.per_page   = 25     # default page size
  f.batch_size = 10     # default batch size
  f.namespace  = "g1"   # only needed if you use the same redis for more than one feed
end

SimpleFeed.define(:group_2) do |f|
  f.provider = SimpleFeed.provider(
    :redis,
    redis: -> { Redis.new(url: SIMPLEFEED_URL) },
    pool_size: 10
  )
  f.per_page   = 25     # default page size
  f.batch_size = 10     # default batch size
  f.namespace  = "g2"   # only needed if you use the same redis for more than one feed
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant