scottburch/couch-ar — pull request #4 by pagameba (2012-02-01 20:10:56+00:00)
Title: Updating init code callback logic

Hi Scott,

I've tweaked the logic for checking if it is safe to call the callback function during init. I haven't had any problems with this not working against my remote server.

I did remove the global timeout that calls the callback function even if not everything loads in this pull request. I was wondering if you would be interested in changing the callback to take an error as the first parameter and the cradle database object as the second parameter to match the general callback pattern used in most node modules. If this is done then the callback could be triggered on a timeout passing an error indicating that not all domains had finished initializing during the timeout period. The timeout period could be an option with a value of 0 being no timeout on initialize (and a default of 60)?