Fracture.prototype._fracture = cadence(function (async, envelope) {
async(function () {
this._getBucket(envelope).turnstile.enter({
when: envelope.when,
method: envelope.body.method,
error: coalesce(envelope.body.error),
object: coalesce(envelope.body.object),
body: coalesce(envelope.body.body),
started: coalesce(envelope.body.started),
completed: async()
})
}, [], function (vargs) {
envelope.body.completed.apply(null, vargs)
})
})
Fracture.prototype.enter = function (envelope) {
this.turnstile.enter({
method: this._$fracture,
when: coalesce(envelope.when, this._Date.now()),
body: {
method: envelope.method,
error: coalesce(envelope.error),
object: coalesce(envelope.object),
body: coalesce(envelope.body),
started: coalesce(envelope.started, noop),
completed: coalesce(envelope.completed, noop),
}
})
}
module.exports = Fracture