bootevent
Quickly describe async tasks needed to complete bootup.
Fluent js interface to acquire
resources in lockstep before
considering a process to be booted
.
install
npm install git://github.com/bewest/bootevent.git
bootevent (ctx, booted)
-> {fluent api}
var bootevent = ;
bootevent
is a function which returns an api:
It takes a context
which is passed around, and optionally takes a
booted
function to be called when everything is ready.
bootevent.acquire
Takes an async function to run, use this to obtain a resource and assign it to your context.
examples
var bootevent = ; return ; ;
{ ctx: [Function],
tap: [Function],
acquire: [Function],
fail: [Function],
boot: [Function] }
context during acquiring db {} { '0': {}, '1': [Function] }
starting acquire { '0': {}, '1': [Function] }
simulated later {}
START PROCESS { '0': { timeout: 2001 } }
It's a "fluent" API so you can stack as many acquire
calls calss as
needed.