1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00

In-memory reaper. TtlSet needs tests.

This commit is contained in:
Simo Kinnunen 2015-06-01 17:39:59 +09:00
parent 89aedcef06
commit 25544d1a1a
10 changed files with 231 additions and 87 deletions

View file

@ -0,0 +1,24 @@
var syrup = require('stf-syrup')
var lifecycle = require('../../../util/lifecycle')
var wire = require('../../../wire')
var wireutil = require('../../../wire/util')
module.exports = syrup.serial()
.dependency(require('../support/push'))
.define(function(options, push) {
function beat() {
push.send([
wireutil.global
, wireutil.envelope(new wire.DeviceHeartbeatMessage(
options.serial
))
])
}
var timer = setInterval(beat, options.heartbeatInterval)
lifecycle.observe(function() {
clearInterval(timer)
})
})