Skip to content

Instantly share code, notes, and snippets.

View juliangoacher's full-sized avatar

Julian Goacher juliangoacher

View GitHub Profile
@juliangoacher
juliangoacher / app-backbone.js
Created June 12, 2017 17:40
Async service startup for node.js
// General app backbone. Start a sequence of services, arranged in dependency order,
// and attach to the app backbone.
const Q = require('q');
// Start the app by completing a sequence of startup steps.
function start( steps ) {
// Convert steps to list of deferreds.
steps = steps.map( ( step ) => {
return ( app ) => {
// Convert step to list of deferred service steps.