phoenixframework / phoenix_pubsub_redis

The Redis PubSub adapter for the Phoenix framework
175 stars 66 forks source link

Add support for a `{:system, "KEY"}` tuple to configure connection URLs #40

Closed jclem closed 4 years ago

jclem commented 5 years ago

In order to support configuring the Redis connection at runtime, this pull request adds support for reading the connection URL from a {:system, "ENVIRONMENT_VARIABLE"} tuple.

This makes it much easier, for example, for a Phoenix app hosted on Heroku to react to changes in a REDIS_URL environment variable that will trigger an application restart.

I'm not sure this is the right approach—perhaps other options should support a system tuple, as well, or there may be a better way of implementing this altogether. I just wanted to open this more as a feature suggestion/point of conversation.

josevalim commented 4 years ago

We are moving away from {:system, ...} tuples in general, especially with the addition of releases. The ones in Phoenix has been deprecated, so we probably shouldn't add this one here. :)