nevans/resque-pool — pull request #82 by jasonrclark (2013-09-05 04:08:16+00:00)
Title: Allow for multiple hooks in after_prefork

Existing versions of Resque::Pool will only allow one caller to set the
`after_prefork` hook. When this is used for something like reestablishing the
ActiveRecord connection, it prevents other libraries from safely registering
their own hook.

I met Jonathan Julian (@jjulian) at RubyNation during a code and coffee event, and
after some conversation decided to dig into why `newrelic_rpm` (which I work
on) wasn't compatible with `resque-pool`. At one point I thought we would need
multiple hooks to get things working, but I've actually managed a fix in the upcoming
agent version that won't require any changes to `resque-pool`. :triumph:

I still think this change is worthwhile even if it's not required for New Relic
support. Resque itself had a similar issue with only allowing on `after_fork`
hook, and it caused us no end of grief when our hooks got tromped by other
libraries and app code.