mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Keep better track of vital streams. Add monkey.
This commit is contained in:
parent
6c350d0068
commit
ae4e4d3075
3 changed files with 146 additions and 4 deletions
24
lib/util/vitals.js
Normal file
24
lib/util/vitals.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
var events = require('events')
|
||||
var util = require('util')
|
||||
|
||||
function Vitals() {
|
||||
events.EventEmitter.call(this)
|
||||
}
|
||||
|
||||
util.inherits(Vitals, events.EventEmitter)
|
||||
|
||||
Vitals.prototype.register = function(name, stream) {
|
||||
var that = this
|
||||
|
||||
stream.on('end', function() {
|
||||
that.emit('end', name)
|
||||
})
|
||||
|
||||
stream.on('error', function(err) {
|
||||
that.emit('error', name, err)
|
||||
})
|
||||
|
||||
return stream
|
||||
}
|
||||
|
||||
module.exports = Vitals
|
Loading…
Add table
Add a link
Reference in a new issue