I find that promises are an elegant dependency resolution mechanism when requesting a resource asynchronously from disparate parts of an application. Promises still rely on callbacks, so the initial pitfall of calling `log()` in `get_database_handle()` could still happen. The main failure I see is that `log()` is called before the function has a chance to change the state of the application to reflect the fact that the resource is already being requested. Instead of creating a new variable to store the state of the request before logging, store a new promise, log, then resolve the promise.