kigster / simple-feed

This gem implements a flexible time-ordered activity feeds commonly used within social networking applications. As events occur, they are pushed into the Feed and distributed to all users that need to see the event. Upon the user visiting their "feed page", a pre-populated ordered list of events is returned by the library.
MIT License
330 stars 30 forks source link

Possible to use without Hiredis? #33

Open pehrlich2 opened 1 year ago

pehrlich2 commented 1 year ago

Hello!

Doing first-time setup here. Following the given installation instructions on ruby 3.2.2 and either OSX or Heroku, I get the following error when starting the server:

LoadError: cannot load such file -- redis/connection/hiredis

Any tips for how to troubleshoot this? Is it possible to opt out of Hiredis, even temporarily? Thanks!

pehrlich2 commented 1 year ago

Looks like this may be the root cause - perhaps there are some minor changes required on the side of simple-feed for compatibility here https://github.com/redis/redis-rb/issues/1178

Edit: seems like editing lib/simplefeed/providers/redis/driver.rb to comment out require 'redis/connection/hiredis' and instead put require "hiredis-client" seems to get my app to boot. It will take a little more time to know if it seems to work as this gem is new to me!

kigster commented 1 year ago

@pehrlich2 thank you so much for reporting this. I would like to clarify your request:

The reason for hiredis to begin with is that it provides a much faster communications with the redis server, where the most high throughput functions are written in plain C.

Let me know!

pehrlich2 commented 1 year ago

Hi!

I think it would be fine to simply update the require statement - as long as that doesn’t cause new problems. Have been using it that way and no trouble so far.

Cheers

On Wed, May 10, 2023 at 12:08 PM Konstantin Gredeskoul < @.***> wrote:

@pehrlich2 https://github.com/pehrlich2 thank you so much for reporting this. I would like to clarify your request:

  • Would you rather see hiredis be optional or
  • do I simply need to change the require to match the recent changes in the hiredis gem?

The reason for hiredis to begin with is that it provides a much faster communications with the redis server, where the most high throughput functions are written in plain C.

Let me know!

— Reply to this email directly, view it on GitHub https://github.com/kigster/simple-feed/issues/33#issuecomment-1542469548, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANFKKBKWTHOQ2FAEMI3GZTTXFO4O3ANCNFSM6AAAAAAXARXFBI . You are receiving this because you were mentioned.Message ID: @.***>

kigster commented 1 year ago

Any chance you might be open to submitting a PR with your solution?

It be great if hiredis was optional, but the README explained how to enable it for high throughput.

kigster commented 7 months ago

Is this still an issue that need solving?

bkmaibach commented 2 months ago

Is this still an issue that need solving?

Yes please!

bkmaibach commented 2 months ago

If you are attempting to use this gem in rails without hiredis (standary ruby driver only) in rails with Redis >5 you can do the following:

Add the following line to boot.rb: $LOAD_PATH.unshift(File.expand_path('../../lib/overrides', FILE))

And then add an empty file at: lib/overrides/redis/connection/hiredis.rb

kigster commented 2 months ago

Thanks. I'll release a fix for this shortly