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

Redis config loader #145

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Redis config loader #145

wants to merge 10 commits into from

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Oct 28, 2015

Based on #144 (to not duplicate autoload/require efforts) and #142 (because this loader ought to always be wrapped in a throttling or memoized loader.

Allows basic setting/loading of configs in redis. By default it stores a separate config per app/host/env, but that can be easily changed (by choosing names that are shared among pools).

joshuaflanagan and others added 10 commits October 26, 2015 18:16
Many custom configuration loaders will retrieve the
configuration from an external resource. `Resque::Pool`
asks the loader for the latest configuration roughly
once per second. You may want to reduce load on your
external resource by caching the value, and only
really fetching the latest configuration after a
specific amount of time has passed.

Instead of forcing each configuration loader author
to re-write (and test) this logic, we provide `Resque::Pool::ConfigThrottle`.

See the spec for full details of its behavior.
n.b. this cleans up the resque/pool/pooled_worker monkeypatching a little bit.
It runs only on `Resque::Pool.new` now.
Intended to be wrapped by `Throttled` config loader.

n.b. if you use this, you will need to reset the redis configuration in your
`after_prefork` hook. (Until #135 handles it automatically.)
@nevans
Copy link
Collaborator Author

nevans commented Oct 28, 2015

n.b. either solve #135 or clearly document that user will need to reconnect in after_prefork

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

Successfully merging this pull request may close these issues.

2 participants